]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: Fix gcc 9 warning -> error issue 4434/head
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 31 May 2019 12:36:37 +0000 (08:36 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 31 May 2019 12:37:34 +0000 (08:37 -0400)
gcc is complaing about this with --enable-dev and --enable-werror:

In function 'nb_log_callback',
    inlined from 'nb_transaction_apply_finish' at lib/northbound.c:1106:4:
lib/northbound.c:777:2: error: '%s' directive argument is null [-Werror=format-overflow=]
  777 |  zlog_debug(
      |  ^~~~~~~~~~~
  778 |   "northbound callback: event [%s] op [%s] xpath [%s] value [%s]",
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  779 |   nb_event_name(event), nb_operation_name(operation), xpath,
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  780 |   value);
      |   ~~~~~~
  CC       lib/ringbuf.lo

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib/northbound.c

index dbf90c58d4870975c4fe05d991000ec94aa39f24..8a5cd0ef14db39012978d2f21720d6330ec3a235 100644 (file)
@@ -777,7 +777,7 @@ static void nb_log_callback(const enum nb_event event,
        zlog_debug(
                "northbound callback: event [%s] op [%s] xpath [%s] value [%s]",
                nb_event_name(event), nb_operation_name(operation), xpath,
-               value);
+               value ? value : "(NULL)");
 }
 
 /*