Imported Upstream version 2.7.1

This commit is contained in:
Laurent Bigonville 2013-11-24 16:00:12 +01:00
parent a1fa151fc7
commit 0121794af9
451 changed files with 41339 additions and 10887 deletions

View file

@ -18,6 +18,7 @@
*/
#include "common.h"
#include "nut_platform.h"
#include <pwd.h>
#include <netdb.h>
@ -202,7 +203,7 @@ static const char *get_data(const char *type, const char *varname)
return answer[3];
}
static void do_string(const char *varname)
static void do_string(const char *varname, const int len)
{
const char *val;
@ -213,6 +214,7 @@ static void do_string(const char *varname)
}
printf("Type: STRING\n");
printf("Maximum length: %d\n", len);
printf("Value: %s\n", val);
}
@ -355,8 +357,13 @@ static void do_type(const char *varname)
}
if (!strncasecmp(answer[i], "STRING:", 7)) {
do_string(varname);
char *len = answer[i] + 7;
int length = strtol(len, NULL, 10);
do_string(varname, length);
return;
}
/* ignore this one */
@ -518,3 +525,11 @@ int main(int argc, char **argv)
exit(EXIT_SUCCESS);
}
/* Formal do_upsconf_args implementation to satisfy linker on AIX */
#if (defined NUT_PLATFORM_AIX)
void do_upsconf_args(char *upsname, char *var, char *val) {
fatalx(EXIT_FAILURE, "INTERNAL ERROR: formal do_upsconf_args called");
}
#endif /* end of #if (defined NUT_PLATFORM_AIX) */