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