- if (strcmp(s, MORSE_COLON) == 0){
- putchar(',');
- } else if (strcmp(s, MORSE_PERIOD) == 0){
- putchar('.');
- } else {
- int found;
- const char *const *a;
- int size;
- int i;
-
- found=0;
- a=digit;
- size=sizeof(digit)/sizeof(digit[0]);
- for (i=0; i<size; i++) {
- if (strcmp(a[i], s) == 0) {
- found = 1;
- break;
- }
+ int i;
+
+ for (i = 0; i < 10; i++)
+ if (strcmp(digit[i], s) == 0) {
+ putchar('0' + i);
+ return;