chiark / gitweb /
dupstr() should take a const char *. In particular, this allows
authorSimon Tatham <anakin@pobox.com>
Tue, 4 May 2004 09:56:38 +0000 (09:56 +0000)
committerSimon Tatham <anakin@pobox.com>
Tue, 4 May 2004 09:56:38 +0000 (09:56 +0000)
compilation under GTK 2.

[originally from svn r4198]

malloc.c
puzzles.h

index 3f6a6a81c5450047a127d531583bd68216211aa3..fd0ddf97c6ca58f278d8a7bca09b0e17f5852ea6 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 035ff24a1770cf8679bcb4fb96162a38cb5d06af..b7d2804dd0c3bcb966e80d064d2688aa5b4ee296 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) \