From 978ae789abd7835b8f941d16ee375b6735dc63b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Wed, 5 Jan 2005 15:22:02 +0000 Subject: [PATCH] constify to avoid warning with -Wwrite-string git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14476 ec53bebd-3082-4978-b11e-865c3cabbd6b --- include/bits.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/bits.c b/include/bits.c index 8e1bc10c2..f5630766c 100644 --- a/include/bits.c +++ b/include/bits.c @@ -112,7 +112,7 @@ int main(int argc, char **argv) { FILE *f; int flag; - char *fn, *hb; + const char *fn, *hb; if(argc < 2){ fn = "bits.h"; @@ -121,9 +121,10 @@ int main(int argc, char **argv) } else { char *p; fn = argv[1]; - hb = malloc(strlen(fn) + 5); - sprintf(hb, "__%s__", fn); - for(p = hb; *p; p++){ + p = malloc(strlen(fn) + 5); + sprintf(p, "__%s__", fn); + hb = p; + for(; *p; p++){ if(!isalnum((unsigned char)*p)) *p = '_'; }