From 7d9a02d836eefadadc4f861a94b5b0a8536dfd35 Mon Sep 17 00:00:00 2001 From: derselbst Date: Thu, 30 Aug 2018 18:40:49 +0200 Subject: [PATCH] replace strlen with FLUID_STRLEN --- src/utils/fluid_settings.c | 8 ++++---- src/utils/fluid_sys.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/utils/fluid_settings.c b/src/utils/fluid_settings.c index 7d4e1748..d77d5ed7 100644 --- a/src/utils/fluid_settings.c +++ b/src/utils/fluid_settings.c @@ -341,7 +341,7 @@ fluid_settings_tokenize(const char *s, char *buf, char **ptr) char *tokstr, *tok; int n = 0; - if(strlen(s) > MAX_SETTINGS_LABEL) + if(FLUID_STRLEN(s) > MAX_SETTINGS_LABEL) { FLUID_LOG(FLUID_ERR, "Setting variable name exceeded max length of %d chars", MAX_SETTINGS_LABEL); @@ -1766,13 +1766,13 @@ fluid_settings_option_concat(fluid_settings_t *settings, const char *name, if(option) { newlist = fluid_list_append(newlist, option); - len += strlen(option); + len += FLUID_STRLEN(option); } } if(count > 1) { - len += (count - 1) * strlen(separator); + len += (count - 1) * FLUID_STRLEN(separator); } len++; /* For terminator */ @@ -1826,7 +1826,7 @@ fluid_settings_foreach_iter(void *key, void *value, void *data) size_t pathlen; char *s; - pathlen = strlen(bag->path); + pathlen = FLUID_STRLEN(bag->path); if(pathlen > 0) { diff --git a/src/utils/fluid_sys.c b/src/utils/fluid_sys.c index 15fce83f..4b73b1d5 100644 --- a/src/utils/fluid_sys.c +++ b/src/utils/fluid_sys.c @@ -1438,7 +1438,7 @@ fluid_ostream_printf(fluid_ostream_t out, const char *format, ...) buf[4095] = 0; #ifndef WIN32 - return write(out, buf, strlen(buf)); + return write(out, buf, FLUID_STRLEN(buf)); #else { int retval; @@ -1446,11 +1446,11 @@ fluid_ostream_printf(fluid_ostream_t out, const char *format, ...) /* Handle write differently depending on if its a socket or file descriptor */ if(!(out & FLUID_SOCKET_FLAG)) { - return write(out, buf, strlen(buf)); + return write(out, buf, FLUID_STRLEN(buf)); } /* Socket */ - retval = send(out & ~FLUID_SOCKET_FLAG, buf, strlen(buf), 0); + retval = send(out & ~FLUID_SOCKET_FLAG, buf, FLUID_STRLEN(buf), 0); return retval != SOCKET_ERROR ? retval : -1; }