From 24498fd0322c8b5852758930e1977eed7d7f6833 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Mon, 5 Feb 1996 21:33:32 +0000 Subject: (line_write, line_fill): Add `const' where appropriate. --- libshouldbeinlibc/=line.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libshouldbeinlibc/=line.c b/libshouldbeinlibc/=line.c index 30fefcb5..1c8eab8e 100644 --- a/libshouldbeinlibc/=line.c +++ b/libshouldbeinlibc/=line.c @@ -1,6 +1,6 @@ /* Simple output formatting functions - Copyright (C) 1995 Free Software Foundation, Inc. + Copyright (C) 1995, 1996 Free Software Foundation, Inc. Written by Miles Bader @@ -66,11 +66,11 @@ line_free (struct line *line) wrap-points. Newlines in STR are honoured by adding a newline and indenting to LMARGIN; any following whitespace is kept. */ void -line_fill (struct line *line, char *str, unsigned lmargin) +line_fill (struct line *line, const char *str, unsigned lmargin) { while (*str) { - char *word_end = str; + const char *word_end = str; while (*word_end == ' ') word_end++; @@ -83,7 +83,7 @@ line_fill (struct line *line, char *str, unsigned lmargin) } else if (*word_end) { - char *word_start = word_end; + const char *word_start = word_end; while (*word_end && !isspace (*word_end)) word_end++; if (line_left (line, word_end - str) >= 0) @@ -126,9 +126,9 @@ _line_cleanup_printf (struct line *line, unsigned added) /* Add STR, of length LEN, to LINE. */ void -line_write (struct line *line, char *str, unsigned len) +line_write (struct line *line, const char *str, unsigned len) { - char *end = memchr (str, '\n', len) ?: str + len; + const char *end = memchr (str, '\n', len) ?: str + len; unsigned line_len = end - str; char *p = line->point, *max = line->max; if (line_len > max - p) -- cgit v1.2.3