diff options
author | Nobuyoshi Nakada <[email protected]> | 2019-08-27 14:20:07 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2019-08-27 14:25:58 +0900 |
commit | 2789bdddc7602fbc2089242d12e5cc4deed181c4 () | |
tree | a6dc039c33ff50d5707be197d0be0d07fc9b7917 /vsnprintf.c | |
parent | d53b669948af29ca086d915c8bded0d1963e2c98 (diff) |
Use array indexing with considering clang's feeling
``` In file included from sprintf.c:1256: ./vsnprintf.c:833:8: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int] IS_PRI_EXTRA_MARK(fmt)) { ^~~~~~~~~~~~~~~~~~~~~~ ./vsnprintf.c:826:34: note: expanded from macro 'IS_PRI_EXTRA_MARK' strncmp((s)+1, PRI_EXTRA_MARK+1, \ ~~~~~~~~~~~~~~^~ ./vsnprintf.c:833:8: note: use array indexing to silence this warning ./vsnprintf.c:826:34: note: expanded from macro 'IS_PRI_EXTRA_MARK' strncmp((s)+1, PRI_EXTRA_MARK+1, \ ^ 1 warning generated. ```
-rw-r--r-- | vsnprintf.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -823,7 +823,7 @@ reswitch: switch (ch) { (PRI_EXTRA_MARK_LEN < 1 || \ (*(s) == PRI_EXTRA_MARK[0] && \ (PRI_EXTRA_MARK_LEN == 1 || \ - strncmp((s)+1, PRI_EXTRA_MARK+1, \ PRI_EXTRA_MARK_LEN-1) == 0))) #else # define PRI_EXTRA_MARK_LEN 0 |