Skip to content

Commit a283837

Browse files
Alex RiesenJunio C Hamano
authored andcommitted
do not discard constness in interp_set_entry value argument
Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 393d340 commit a283837

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

interpolate.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
#include "interpolate.h"
99

1010

11-
void interp_set_entry(struct interp *table, int slot, char *value)
11+
void interp_set_entry(struct interp *table, int slot, const char *value)
1212
{
1313
char *oldval = table[slot].value;
14-
char *newval = value;
14+
char *newval = NULL;
1515

1616
if (oldval)
1717
free(oldval);

interpolate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ struct interp {
1616
char *value;
1717
};
1818

19-
extern void interp_set_entry(struct interp *table, int slot, char *value);
19+
extern void interp_set_entry(struct interp *table, int slot, const char *value);
2020
extern void interp_clear_table(struct interp *table, int ninterps);
2121

2222
extern int interpolate(char *result, int reslen,

0 commit comments

Comments
 (0)