logging: fix missing description of global loglevel
authorPablo Neira Ayuso <pablo@gnumonks.org>
Tue, 3 May 2011 20:32:32 +0000 (22:32 +0200)
committerHarald Welte <laforge@gnumonks.org>
Wed, 4 May 2011 09:07:13 +0000 (11:07 +0200)
OpenBSC> logging level
  all    Global setting for all subsystems <----- this description was missing
  rll    A-bis Radio Link Layer (RLL)
[...]

This problem was introduced by myself in:
"vty: integration with logging framework"
04139f14b6197e3ec996133a945af3fa8a68fb7a

src/logging.c

index 77c8a50..7b1ab13 100644 (file)
@@ -517,6 +517,7 @@ const char *log_vty_command_description(const struct log_info *info)
        for (i = 0; i < LOGLEVEL_DEFS; i++)
                size += strlen(loglevel_descriptions[i]) + 1;
 
+       size += strlen("Global setting for all subsystems") + 1;
        rem = size;
        str = talloc_zero_size(NULL, size);
        if (!str)
@@ -528,6 +529,12 @@ const char *log_vty_command_description(const struct log_info *info)
                goto err;
        OSMO_SNPRINTF_RET(ret, rem, offset, len);
 
+       ret = snprintf(str + offset, rem,
+                       "Global setting for all subsystems\n");
+       if (ret < 0)
+               goto err;
+       OSMO_SNPRINTF_RET(ret, rem, offset, len);
+
        for (i = 0; i < info->num_cat; i++) {
                ret = snprintf(str + offset, rem, "%s\n",
                                info->cat[i].description);