Skip to content

Commit

Permalink
Don't reference malloc if not using alloc/free
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich Barlow committed Apr 10, 2017
1 parent 09bdc2f commit 219ca4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libscpi/src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ int OUR_strncasecmp(const char *s1, const char *s2, size_t n) {
}
#endif

#if !HAVE_STRNDUP
#if USE_MEMORY_ALLOCATION_FREE && !HAVE_STRNDUP
char *OUR_strndup(const char *s, size_t n) {
size_t len = SCPIDEFINE_strnlen(s, n);
char * result = malloc(len + 1);
Expand Down

0 comments on commit 219ca4f

Please sign in to comment.