* Add support for other operating systems (kFreeBSD, FreeBSD, and OSX for now).

* Switch to autoconf from genconfig.sh.
This commit is contained in:
Justin Maggard
2011-09-16 23:39:58 +00:00
parent 715af3519b
commit 773e1f6566
40 changed files with 1952 additions and 533 deletions

View File

@ -76,7 +76,7 @@ readoptionsfile(const char * fname)
int i;
enum upnpconfigoptions id;
if(!fname || (strlen(fname) == 0))
if(!fname || *fname == '\0')
return -1;
memset(buffer, 0, sizeof(buffer));
@ -155,8 +155,17 @@ readoptionsfile(const char * fname)
}
else
{
num_options += 1;
ary_options = (struct option *) realloc(ary_options, num_options * sizeof(struct option));
num_options++;
t = realloc(ary_options, num_options * sizeof(struct option));
if(!t)
{
fprintf(stderr, "memory allocation error: %s=%s\n",
name, value);
num_options--;
continue;
}
else
ary_options = (struct option *)t;
ary_options[num_options-1].id = id;
strncpy(ary_options[num_options-1].value, value, MAX_OPTION_VALUE_LEN);