aboutsummaryrefslogtreecommitdiff
path: root/locale
diff options
context:
space:
mode:
Diffstat (limited to 'locale')
-rw-r--r--locale/programs/charmap.c6
-rw-r--r--locale/programs/locale.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/locale/programs/charmap.c b/locale/programs/charmap.c
index 359b913c1f..416615a1b9 100644
--- a/locale/programs/charmap.c
+++ b/locale/programs/charmap.c
@@ -114,9 +114,9 @@ charmap_read (const char *filename)
if (fscanf (fp, " <code_set_name> %as", &name) == 1)
break;
- do
- fgets (junk, sizeof junk, fp);
- while (strchr (junk, '\n') == NULL);
+ while (fgets (junk, sizeof junk, fp) != NULL
+ && strchr (junk, '\n') == NULL)
+ continue;
}
fclose (fp);
diff --git a/locale/programs/locale.c b/locale/programs/locale.c
index 28ad94403f..52ae56a819 100644
--- a/locale/programs/locale.c
+++ b/locale/programs/locale.c
@@ -504,9 +504,9 @@ write_charmaps (void)
if (fscanf (fp, " <code_set_name> %as", &name) == 1)
break;
- do
- fgets (junk, sizeof junk, fp);
- while (strchr (junk, '\n') == NULL);
+ while (fgets (junk, sizeof junk, fp) != NULL
+ && strchr (junk, '\n') == NULL)
+ continue;
}
fclose (fp);