about summary refs log tree commit diff
path: root/locale/programs/charmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'locale/programs/charmap.c')
-rw-r--r--locale/programs/charmap.c6
1 files changed, 3 insertions, 3 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);