dupstr() should take a const char *. In particular, this allows
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 4 May 2004 09:56:38 +0000 (09:56 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 4 May 2004 09:56:38 +0000 (09:56 +0000)
compilation under GTK 2.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@4198 cda61777-01e9-0310-a592-d414129be87e

malloc.c
puzzles.h

index 3f6a6a8..fd0ddf9 100644 (file)
--- a/malloc.c
+++ b/malloc.c
@@ -46,7 +46,7 @@ void *srealloc(void *p, int size) {
  * dupstr is like strdup, but with the never-return-NULL property
  * of smalloc (and also reliably defined in all environments :-)
  */
-char *dupstr(char *s) {
+char *dupstr(const char *s) {
     char *r = smalloc(1+strlen(s));
     strcpy(r,s);
     return r;
index 035ff24..b7d2804 100644 (file)
--- a/puzzles.h
+++ b/puzzles.h
@@ -127,7 +127,7 @@ char *midend_set_config(midend_data *me, int which, config_item *cfg);
 void *smalloc(int size);
 void *srealloc(void *p, int size);
 void sfree(void *p);
-char *dupstr(char *s);
+char *dupstr(const char *s);
 #define snew(type) \
     ( (type *) smalloc (sizeof (type)) )
 #define snewn(number, type) \