examples/libcoap: fix compile error in example.
authorJunyeon LEE <junyeon2.lee@samsung.com>
Fri, 23 Jun 2017 13:58:34 +0000 (22:58 +0900)
committerEunBong Song <eunb.song@samsung.com>
Tue, 11 Jul 2017 11:13:35 +0000 (20:13 +0900)
This commit is to fix below compilation error on client example.

CC: libcoap-client.c
libcoap-client.c:787:47: error: '_token_data' is static but used
            in inline function 'cmdline_token' which is not static [-Werror]
  strncpy((char *)the_token.s, arg, min(sizeof(_token_data), strlen(arg)));
                                               ^
libcoap-client.c:82:32: note: in definition of macro 'min'
 #define min(a,b) ((a) < (b) ? (a) : (b))
                                ^
ibcoap-client.c:787:47: error: '_token_data' is static but used
            in inline function 'cmdline_token' which is not static [-Werror]
  strncpy((char *)the_token.s, arg, min(sizeof(_token_data), strlen(arg)));
                                               ^
libcoap-client.c:82:20: note: in definition of macro 'min'
 #define min(a,b) ((a) < (b) ? (a) : (b))
                    ^
Signed-off-by: Junyeon LEE <junyeon2.lee@samsung.com>
Change-Id: I820e3c872ca100b9e34027e1d28e4b4f42c78d11

apps/examples/libcoap_client/libcoap-client.c

index d7467a9..47f27f5 100644 (file)
@@ -782,7 +782,7 @@ int cmdline_proxy(char *arg)
        return 1;
 }
 
-inline void cmdline_token(char *arg)
+inline static void cmdline_token(char *arg)
 {
        strncpy((char *)the_token.s, arg, min(sizeof(_token_data), strlen(arg)));
        the_token.length = strlen(arg);