My own rewrite of the BSD morse code recreational utility
修订版 | 154b2b7e042756a20afd8b7a81a8d0e1bb49c3d6 (tree) |
---|---|
时间 | 2021-08-30 02:43:52 |
作者 | Joel Matthew Rees <joel.rees@gmai...> |
Commiter | Joel Matthew Rees |
decode works?
@@ -189,6 +189,7 @@ totextif(s) | ||
189 | 189 | { |
190 | 190 | int i; |
191 | 191 | |
192 | +/*dbg* / printf( "entering totextif(): %s\n", s ); */ | |
192 | 193 | for (i = 0; i < 10; i++) |
193 | 194 | if (strcmp(digit[i], s) == 0) { |
194 | 195 | return '0' + i; |
@@ -339,11 +340,11 @@ main(argc, argv) | ||
339 | 340 | |
340 | 341 | if (dflag) { |
341 | 342 | if (*argvp) { |
342 | - char outstr; | |
343 | + char outch = 'x'; | |
343 | 344 | do { |
344 | 345 | /* decode(*argvp); */ |
345 | - outstr = totextif( argvp ); | |
346 | - putchar( outstr ); | |
346 | + outch = totextif( *argvp ); | |
347 | + putchar( outch ); | |
347 | 348 | } while (*++argvp); |
348 | 349 | } else { |
349 | 350 | char foo[10]; /* All morse chars shorter than this */ |