mirror of
https://github.com/sheumann/hush.git
synced 2025-01-12 14:30:54 +00:00
Fix some warnings that have crept in recently
This commit is contained in:
parent
07085855ad
commit
638da75f4b
@ -313,7 +313,7 @@ static int parse_file_cmd(sed_cmd_t * sed_cmd, const char *filecmdstr, char **re
|
|||||||
return idx;
|
return idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int parse_subst_cmd(sed_cmd_t * const sed_cmd, const char *substr)
|
static int parse_subst_cmd(sed_cmd_t * const sed_cmd, char *substr)
|
||||||
{
|
{
|
||||||
int cflags = 0;
|
int cflags = 0;
|
||||||
char *match;
|
char *match;
|
||||||
@ -462,13 +462,13 @@ void add_cmd(char *cmdstr)
|
|||||||
/* Append this line to any unfinished line from last time. */
|
/* Append this line to any unfinished line from last time. */
|
||||||
if(add_cmd_line) {
|
if(add_cmd_line) {
|
||||||
int lastlen=strlen(add_cmd_line);
|
int lastlen=strlen(add_cmd_line);
|
||||||
char *temp=xmalloc(lastlen+strlen(cmdstr)+2);
|
char *tmp=xmalloc(lastlen+strlen(cmdstr)+2);
|
||||||
|
|
||||||
memcpy(temp,add_cmd_line,lastlen);
|
memcpy(tmp,add_cmd_line,lastlen);
|
||||||
temp[lastlen]='\n';
|
tmp[lastlen]='\n';
|
||||||
strcpy(temp+lastlen+1,cmdstr);
|
strcpy(tmp+lastlen+1,cmdstr);
|
||||||
free(add_cmd_line);
|
free(add_cmd_line);
|
||||||
cmdstr=add_cmd_line=temp;
|
cmdstr=add_cmd_line=tmp;
|
||||||
} else add_cmd_line=NULL;
|
} else add_cmd_line=NULL;
|
||||||
|
|
||||||
/* If this line ends with backslash, request next line. */
|
/* If this line ends with backslash, request next line. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user