changeset 11423:a096f82d87d9

(main): Check for trailing ", " before trying to delete it.
author Karl Heuer <kwzh@gnu.org>
date Thu, 13 Apr 1995 17:06:05 +0000
parents fd0a461e9c72
children 29493ce2d1ca
files lib-src/b2m.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/b2m.c	Thu Apr 13 17:05:39 1995 +0000
+++ b/lib-src/b2m.c	Thu Apr 13 17:06:05 1995 +0000
@@ -131,7 +131,9 @@
 	      while (p = strtok (NULL, " ,\r\n\t"))
 		labels = concat (labels, p, ", ");
 
-	      labels[strlen (labels) - 2] = '\0';
+	      p = &labels[strlen (labels) - 2];
+	      if (*p == ',')
+		*p = '\0';
 	      printing = header = FALSE;
 	      labels_saved = TRUE;
 	      continue;