From: Alex Riesen Date: Thu, 28 Sep 2006 19:12:55 +0000 (+0200) Subject: do not discard constness in interp_set_entry value argument X-Git-Tag: v1.4.3-rc1~11 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a28383770ec44357bfce4af834dc09bf14d9410e;p=git.git do not discard constness in interp_set_entry value argument Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- diff --git a/interpolate.c b/interpolate.c index 62701d843..5d9d1889f 100644 --- a/interpolate.c +++ b/interpolate.c @@ -8,10 +8,10 @@ #include "interpolate.h" -void interp_set_entry(struct interp *table, int slot, char *value) +void interp_set_entry(struct interp *table, int slot, const char *value) { char *oldval = table[slot].value; - char *newval = value; + char *newval = NULL; if (oldval) free(oldval); diff --git a/interpolate.h b/interpolate.h index a55fb8e07..190a180b5 100644 --- a/interpolate.h +++ b/interpolate.h @@ -16,7 +16,7 @@ struct interp { char *value; }; -extern void interp_set_entry(struct interp *table, int slot, char *value); +extern void interp_set_entry(struct interp *table, int slot, const char *value); extern void interp_clear_table(struct interp *table, int ninterps); extern int interpolate(char *result, int reslen,