diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-06-11 12:05:24 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-06-11 12:05:24 +0200 |
| commit | b4d33513bd44c82426ef9e3c6daf5b8046672514 (patch) | |
| tree | db64d441059897974d270614cd1ad22d15fc8e56 /utils/h48_to_lst.c | |
| parent | c89c5a1832354d656757c5aff49018d0313838e0 (diff) | |
| download | nissy-core-b4d33513bd44c82426ef9e3c6daf5b8046672514.tar.gz nissy-core-b4d33513bd44c82426ef9e3c6daf5b8046672514.zip | |
Finished refactor
Diffstat (limited to 'utils/h48_to_lst.c')
| -rw-r--r-- | utils/h48_to_lst.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/utils/h48_to_lst.c b/utils/h48_to_lst.c index d06694b..977c95d 100644 --- a/utils/h48_to_lst.c +++ b/utils/h48_to_lst.c | |||
| @@ -7,13 +7,16 @@ | |||
| 7 | #define STRLENMAX 1000 | 7 | #define STRLENMAX 1000 |
| 8 | 8 | ||
| 9 | int main(void) { | 9 | int main(void) { |
| 10 | char str[STRLENMAX]; | 10 | char strin[STRLENMAX], strout[STRLENMAX]; |
| 11 | cube_t cube; | 11 | int result; |
| 12 | 12 | ||
| 13 | fgets(str, STRLENMAX, stdin); | 13 | fgets(strin, STRLENMAX, stdin); |
| 14 | cube = readcube("H48", str); | 14 | |
| 15 | writecube("LST", cube, str); | 15 | result = nissy_convertcube("H48", "LST", strin, strout); |
| 16 | fputs(str, stdout); | 16 | if (result) |
| 17 | fprintf(stderr, "Error converting cube: code %d\n", result); | ||
| 18 | |||
| 19 | fputs(strout, stdout); | ||
| 17 | 20 | ||
| 18 | return 0; | 21 | return 0; |
| 19 | } | 22 | } |
