Imported Upstream version 2.6.1
This commit is contained in:
parent
459aaf9392
commit
a367d9bc54
178 changed files with 4651 additions and 3279 deletions
|
|
@ -375,7 +375,7 @@ static int is_valid_data(const char* varname)
|
|||
* enforcing controls! We also need a way to automate
|
||||
* the update / sync process (with cmdvartab?!) */
|
||||
|
||||
upsdebugx(1, "Unknown data. Commiting anyway...");
|
||||
upsdebugx(1, "Unknown data. Committing anyway...");
|
||||
return 1;
|
||||
/* return 0;*/
|
||||
}
|
||||
|
|
@ -395,7 +395,7 @@ static int is_valid_value(const char* varname, const char *value)
|
|||
* enforcing controls! We also need a way to automate
|
||||
* the update / sync process (with cmdvartab?) */
|
||||
|
||||
upsdebugx(1, "Unknown data. Commiting value anyway...");
|
||||
upsdebugx(1, "Unknown data. Committing value anyway...");
|
||||
return 1;
|
||||
/* return 0;*/
|
||||
}
|
||||
|
|
@ -412,7 +412,7 @@ static void upsconf_err(const char *errmsg)
|
|||
static int parse_data_file(int upsfd)
|
||||
{
|
||||
char fn[SMALLBUF];
|
||||
char *ptr, *var_value = (char*) xmalloc(MAX_STRING_SIZE);
|
||||
char *ptr, var_value[MAX_STRING_SIZE];
|
||||
int value_args = 0, counter;
|
||||
time_t now;
|
||||
|
||||
|
|
@ -501,13 +501,13 @@ static int parse_data_file(int upsfd)
|
|||
}
|
||||
else
|
||||
{
|
||||
memset(var_value, 0, MAX_STRING_SIZE);
|
||||
for (counter = 1, value_args = ctx->numargs ;
|
||||
counter < value_args ; counter++)
|
||||
{
|
||||
if (counter != 1) /* don't append the first space separator */
|
||||
strncat(var_value, " ", 1);
|
||||
strncat(var_value, ctx->arglist[counter], MAX_STRING_SIZE);
|
||||
if (counter == 1) /* don't append the first space separator */
|
||||
snprintf(var_value, sizeof(var_value), "%s", ctx->arglist[counter]);
|
||||
else
|
||||
snprintfcat(var_value, sizeof(var_value), " %s", ctx->arglist[counter]);
|
||||
}
|
||||
|
||||
if (setvar(ctx->arglist[0], var_value) == STAT_SET_UNKNOWN)
|
||||
|
|
@ -529,7 +529,6 @@ static int parse_data_file(int upsfd)
|
|||
pconf_finish(ctx);
|
||||
free(ctx);
|
||||
ctx=NULL;
|
||||
free(var_value);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue