Browse Source

Remove duplicated field load error strings

master
cancel 5 years ago
parent
commit
c6d981d35b
  1. 22
      cli_main.c

22
cli_main.c

@ -76,27 +76,7 @@ int main(int argc, char **argv) {
Field_load_error fle = field_load_file(input_file, &field); Field_load_error fle = field_load_file(input_file, &field);
if (fle != Field_load_error_ok) { if (fle != Field_load_error_ok) {
field_deinit(&field); field_deinit(&field);
char const *errstr = "Unknown"; fprintf(stderr, "File load error: %s.\n", field_load_error_string(fle));
switch (fle) {
case Field_load_error_ok:
break;
case Field_load_error_cant_open_file:
errstr = "Unable to open file";
break;
case Field_load_error_too_many_columns:
errstr = "Grid file has too many columns";
break;
case Field_load_error_too_many_rows:
errstr = "Grid file has too many rows";
break;
case Field_load_error_no_rows_read:
errstr = "Grid file has no rows";
break;
case Field_load_error_not_a_rectangle:
errstr = "Grid file is not a rectangle";
break;
}
fprintf(stderr, "File load error: %s.\n", errstr);
return 1; return 1;
} }
Mbuf_reusable mbuf_r; Mbuf_reusable mbuf_r;

Loading…
Cancel
Save