replace strlen with FLUID_STRLEN

This commit is contained in:
derselbst 2018-08-30 18:40:49 +02:00
parent cdc8d38f4e
commit 7d9a02d836
2 changed files with 7 additions and 7 deletions

View file

@ -341,7 +341,7 @@ fluid_settings_tokenize(const char *s, char *buf, char **ptr)
char *tokstr, *tok; char *tokstr, *tok;
int n = 0; 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", FLUID_LOG(FLUID_ERR, "Setting variable name exceeded max length of %d chars",
MAX_SETTINGS_LABEL); MAX_SETTINGS_LABEL);
@ -1766,13 +1766,13 @@ fluid_settings_option_concat(fluid_settings_t *settings, const char *name,
if(option) if(option)
{ {
newlist = fluid_list_append(newlist, option); newlist = fluid_list_append(newlist, option);
len += strlen(option); len += FLUID_STRLEN(option);
} }
} }
if(count > 1) if(count > 1)
{ {
len += (count - 1) * strlen(separator); len += (count - 1) * FLUID_STRLEN(separator);
} }
len++; /* For terminator */ len++; /* For terminator */
@ -1826,7 +1826,7 @@ fluid_settings_foreach_iter(void *key, void *value, void *data)
size_t pathlen; size_t pathlen;
char *s; char *s;
pathlen = strlen(bag->path); pathlen = FLUID_STRLEN(bag->path);
if(pathlen > 0) if(pathlen > 0)
{ {

View file

@ -1438,7 +1438,7 @@ fluid_ostream_printf(fluid_ostream_t out, const char *format, ...)
buf[4095] = 0; buf[4095] = 0;
#ifndef WIN32 #ifndef WIN32
return write(out, buf, strlen(buf)); return write(out, buf, FLUID_STRLEN(buf));
#else #else
{ {
int retval; 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 */ /* Handle write differently depending on if its a socket or file descriptor */
if(!(out & FLUID_SOCKET_FLAG)) if(!(out & FLUID_SOCKET_FLAG))
{ {
return write(out, buf, strlen(buf)); return write(out, buf, FLUID_STRLEN(buf));
} }
/* Socket */ /* 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; return retval != SOCKET_ERROR ? retval : -1;
} }