diff options
Diffstat (limited to 'lib-src/b2m.c')
| -rw-r--r-- | lib-src/b2m.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib-src/b2m.c b/lib-src/b2m.c index f31b33f9780..803d75e233c 100644 --- a/lib-src/b2m.c +++ b/lib-src/b2m.c | |||
| @@ -68,9 +68,9 @@ extern char *strtok(char *, const char *); | |||
| 68 | 68 | ||
| 69 | long *xmalloc (unsigned int size); | 69 | long *xmalloc (unsigned int size); |
| 70 | long *xrealloc (char *ptr, unsigned int size); | 70 | long *xrealloc (char *ptr, unsigned int size); |
| 71 | char *concat (char *s1, char *s2, char *s3); | 71 | char *concat (const char *s1, const char *s2, const char *s3); |
| 72 | long readline (struct linebuffer *linebuffer, register FILE *stream); | 72 | long readline (struct linebuffer *linebuffer, register FILE *stream); |
| 73 | void fatal (char *message) NO_RETURN; | 73 | void fatal (const char *message) NO_RETURN; |
| 74 | 74 | ||
| 75 | /* | 75 | /* |
| 76 | * xnew -- allocate storage. SYNOPSIS: Type *xnew (int n, Type); | 76 | * xnew -- allocate storage. SYNOPSIS: Type *xnew (int n, Type); |
| @@ -170,6 +170,7 @@ main (int argc, char **argv) | |||
| 170 | continue; | 170 | continue; |
| 171 | else if (data.buffer[1] == '\f') | 171 | else if (data.buffer[1] == '\f') |
| 172 | { | 172 | { |
| 173 | static char babyl[] = "X-Babyl-Labels: "; | ||
| 173 | if (first) | 174 | if (first) |
| 174 | first = FALSE; | 175 | first = FALSE; |
| 175 | else if (! last_was_blank_line) | 176 | else if (! last_was_blank_line) |
| @@ -177,7 +178,7 @@ main (int argc, char **argv) | |||
| 177 | /* Save labels. */ | 178 | /* Save labels. */ |
| 178 | readline (&data, stdin); | 179 | readline (&data, stdin); |
| 179 | p = strtok (data.buffer, " ,\r\n\t"); | 180 | p = strtok (data.buffer, " ,\r\n\t"); |
| 180 | labels = "X-Babyl-Labels: "; | 181 | labels = babyl; |
| 181 | 182 | ||
| 182 | while ((p = strtok (NULL, " ,\r\n\t"))) | 183 | while ((p = strtok (NULL, " ,\r\n\t"))) |
| 183 | labels = concat (labels, p, ", "); | 184 | labels = concat (labels, p, ", "); |
| @@ -218,7 +219,7 @@ main (int argc, char **argv) | |||
| 218 | * concatenate those of s1, s2, s3. | 219 | * concatenate those of s1, s2, s3. |
| 219 | */ | 220 | */ |
| 220 | char * | 221 | char * |
| 221 | concat (char *s1, char *s2, char *s3) | 222 | concat (const char *s1, const char *s2, const char *s3) |
| 222 | { | 223 | { |
| 223 | int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3); | 224 | int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3); |
| 224 | char *result = xnew (len1 + len2 + len3 + 1, char); | 225 | char *result = xnew (len1 + len2 + len3 + 1, char); |
| @@ -305,7 +306,7 @@ xrealloc (char *ptr, unsigned int size) | |||
| 305 | } | 306 | } |
| 306 | 307 | ||
| 307 | void | 308 | void |
| 308 | fatal (char *message) | 309 | fatal (const char *message) |
| 309 | { | 310 | { |
| 310 | fprintf (stderr, "%s: %s\n", progname, message); | 311 | fprintf (stderr, "%s: %s\n", progname, message); |
| 311 | exit (EXIT_FAILURE); | 312 | exit (EXIT_FAILURE); |