- while (fgets(buffer, sizeof(buffer), ifp) != 0) {
- if (*buffer == '#')
- continue;
- if (sscanf(buffer, "%s %s", to, from) == 2) {
- int code = lookup(from);
- if (code == UNKNOWN)
- continue;
- if ((int)strlen(from) > maxlen)
- maxlen = strlen(from);
- fprintf(ofp, "\t{ %4d, %-*.*s },\t/* %s */\n",
- code,
- maxlen, maxlen,
- to,
- from);
- }
+ scanned = sscanf(buffer, "%255s %255s", to, from);
+ if (scanned == 2) {
+ unsigned code = lookup(from);
+ if (code == UNKNOWN)
+ continue;
+ if (strlen(from) > maxlen)
+ maxlen = (unsigned) strlen(from);
+ fprintf(ofp, "\t{ %4u, %-*.*s },\t/* %s */\n",
+ code,
+ (int) maxlen, (int) maxlen,
+ to,
+ from);