1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

Cleanup cmd_string_uppercase

This commit is contained in:
Ángel González 2013-06-22 00:06:31 +02:00 committed by Giuseppe Scrivano
parent 4df7703d62
commit 49f6d0ded8
2 changed files with 12 additions and 7 deletions

View File

@ -1,3 +1,7 @@
2013-06-22 Ángel González <keisial@gmail.com>
* init.c (cmd_string_uppercase): Rewrite function.
2013-06-19 Tim Ruehsen <tim.ruehsen@gmx.de> 2013-06-19 Tim Ruehsen <tim.ruehsen@gmx.de>
* connect.c (socket_ip_address): zero out ip address structure to * connect.c (socket_ip_address): zero out ip address structure to

View File

@ -965,15 +965,16 @@ cmd_string (const char *com, const char *val, void *place)
static bool static bool
cmd_string_uppercase (const char *com, const char *val, void *place) cmd_string_uppercase (const char *com, const char *val, void *place)
{ {
char *q; char *q, **pstring;
bool ret = cmd_string (com, val, place); pstring = (char **)place;
q = *((char **) place); xfree_null (*pstring);
if (!ret || q == NULL)
return false;
for ( ;*q; *q++) *pstring = xmalloc (strlen (val) + 1);
*q = c_toupper (*q);
for (q = *pstring; *val; val++, q++)
*q = c_toupper (*val);
*q = '\0';
return true; return true;
} }