diff options
author | David Sommerseth <dazo@users.sourceforge.net> | 2009-09-25 13:14:35 +0200 |
---|---|---|
committer | David Sommerseth <dazo@users.sourceforge.net> | 2009-09-25 13:14:35 +0200 |
commit | 3b79f0183dde8e2b2694dc26da836c75640d8c5d (patch) | |
tree | f323d6de64a4dc81ef8f4d6f8b80d5f136121d26 /common | |
parent | ea848bbd45b4ede131d1a3514844c22d50736645 (diff) | |
download | eurephia-3b79f0183dde8e2b2694dc26da836c75640d8c5d.tar.gz eurephia-3b79f0183dde8e2b2694dc26da836c75640d8c5d.tar.xz eurephia-3b79f0183dde8e2b2694dc26da836c75640d8c5d.zip |
Moved the useful append_str() macro from sqlite.c to eurephia_nullsafe.h
Diffstat (limited to 'common')
-rw-r--r-- | common/eurephia_nullsafe.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/common/eurephia_nullsafe.h b/common/eurephia_nullsafe.h index 5f6b58c..22d50ed 100644 --- a/common/eurephia_nullsafe.h +++ b/common/eurephia_nullsafe.h @@ -59,6 +59,17 @@ /** + * Wrapper macro, which appends a string to a destination string without exceeding the size + * of the destination buffer. + * + * @param dest Pointer to the destination buffer + * @param src Pointer to the value being concatenated to the destination string. + * @param size Size of the destination buffer + */ +#define append_str(dest, src, size) strncat(dest, src, (size - strlen_nullsafe(dest))) + + +/** * strlen() wrapper. Returns the length of a string * * @param str Input string |