aboutsummaryrefslogtreecommitdiff
path: root/lib/mprintf.c
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2004-12-15 01:38:25 +0000
committerDan Fandrich <dan@coneharvesters.com>2004-12-15 01:38:25 +0000
commit1ba47e7af9edfa682faba73df8bf0dc240facb19 (patch)
tree38a53c7789ef88b169a8ee41642e702a2c34a904 /lib/mprintf.c
parent9359498b065a98361c25a9635aac1284ea261903 (diff)
Add 'const' to immutable arrays.
Diffstat (limited to 'lib/mprintf.c')
-rw-r--r--lib/mprintf.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/mprintf.c b/lib/mprintf.c
index 56bede316..30f0f7aa5 100644
--- a/lib/mprintf.c
+++ b/lib/mprintf.c
@@ -816,8 +816,8 @@ static int dprintf_formatf(
case FORMAT_STRING:
/* String. */
{
- static char null[] = "(nil)";
- char *str;
+ static const char null[] = "(nil)";
+ const char *str;
size_t len;
str = (char *) p->data.str;
@@ -830,7 +830,7 @@ static int dprintf_formatf(
p->flags &= (~FLAGS_ALT);
}
else {
- str = (char *)"";
+ str = "";
len = 0;
}
}
@@ -875,8 +875,8 @@ static int dprintf_formatf(
}
else {
/* Write "(nil)" for a nil pointer. */
- static char strnil[] = "(nil)";
- char *point;
+ static const char strnil[] = "(nil)";
+ const char *point;
width -= sizeof(strnil) - 1;
if (p->flags & FLAGS_LEFT)