Mercurial > ~mikael > mcabber > hg
diff mcabber/mcabber/utils.c @ 2119:3b26f3a58cb9
Fix command line issue reported by Minos
Fix small memory corruption in strip_arg_special_chars().
strcpy() cannot be used there because the areas overlap.
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Tue, 24 Jun 2014 18:56:24 +0200 |
parents | 9023a6f2bf6c |
children | 69d00a118c0c |
line wrap: on
line diff
--- a/mcabber/mcabber/utils.c Mon Jun 09 10:01:48 2014 +0200 +++ b/mcabber/mcabber/utils.c Tue Jun 24 18:56:24 2014 +0200 @@ -589,13 +589,17 @@ if (*p == '"') { if (!escape) { instring = !instring; - strcpy(p, p+1); + //memmove(p, p+1, strlen(p)); + for (char *t=p; *t; t++) + *t = *(t+1); p--; } else escape = FALSE; } else if (*p == '\\') { if (!escape) { - strcpy(p, p+1); + //memmove(p, p+1, strlen(p)); + for (char *t=p; *t; t++) + *t = *(t+1); p--; } escape = !escape;