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:
parent
4df7703d62
commit
49f6d0ded8
@ -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>
|
||||
|
||||
* connect.c (socket_ip_address): zero out ip address structure to
|
||||
|
15
src/init.c
15
src/init.c
@ -965,15 +965,16 @@ cmd_string (const char *com, const char *val, void *place)
|
||||
static bool
|
||||
cmd_string_uppercase (const char *com, const char *val, void *place)
|
||||
{
|
||||
char *q;
|
||||
bool ret = cmd_string (com, val, place);
|
||||
q = *((char **) place);
|
||||
if (!ret || q == NULL)
|
||||
return false;
|
||||
char *q, **pstring;
|
||||
pstring = (char **)place;
|
||||
xfree_null (*pstring);
|
||||
|
||||
for ( ;*q; *q++)
|
||||
*q = c_toupper (*q);
|
||||
*pstring = xmalloc (strlen (val) + 1);
|
||||
|
||||
for (q = *pstring; *val; val++, q++)
|
||||
*q = c_toupper (*val);
|
||||
|
||||
*q = '\0';
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user