diff options
author | Joe Orton <jorton@redhat.com> | 2020-09-21 14:53:44 +0100 |
---|---|---|
committer | Joe Orton <jorton@redhat.com> | 2020-09-21 14:53:44 +0100 |
commit | 0bdf3460e53a1ee89324a0e778abe3c8ca52369e (patch) | |
tree | b39a609a0c2ca0e7189e2e8fd0c54b889d3b0904 | |
parent | ab08ac5dded681b89ac28d26f26bf22177343cb8 (diff) | |
download | neon-git-0bdf3460e53a1ee89324a0e778abe3c8ca52369e.tar.gz |
* src/ne_string.h: Add nonnull attribute to ne_strclean,
add malloc attribute to ne_strnqdup.
-rw-r--r-- | src/ne_string.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ne_string.h b/src/ne_string.h index 34edd06..b320ec4 100644 --- a/src/ne_string.h +++ b/src/ne_string.h @@ -46,7 +46,8 @@ char *ne_shave(char *str, const char *whitespace); /* Cleanse 'str' of non-printable (e.g. control) characters. 'str' is * modified in-place, and returned. */ -char *ne_strclean(char *str); +char *ne_strclean(char *str) + ne_attribute((nonnull)); /* Encode 'len' bytes of 'text' to base64. Returns malloc-allocated * NUL-terminated buffer which the caller must free(). */ @@ -142,7 +143,8 @@ strncpy(dest, src, ne__nm1); dest[ne__nm1] = '\0'; } while (0) /* Return a malloc-allocated copy of 'data', of length 'len', with all * non-ASCII bytes, and ASCII control characters escaped. (Note that * the escaping includes the NUL byte). */ -char *ne_strnqdup(const unsigned char *data, size_t len); +char *ne_strnqdup(const unsigned char *data, size_t len) + ne_attribute_malloc; /* Return malloc-allocated concatenation of all NUL-terminated string * arguments, up to a terminating NULL pointer. */ |