summaryrefslogtreecommitdiffstats
path: root/src/internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/internal.h')
-rw-r--r--src/internal.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/internal.h b/src/internal.h
index 2106401..f0cc2e1 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -21,4 +21,15 @@
# endif
#endif
+#define SNPRINTF_CHECK(ret, rem, offset, len) \
+do { \
+ if (ret < 0) \
+ return ret; \
+ len += ret; \
+ if (ret > rem) \
+ ret = rem; \
+ offset += ret; \
+ rem -= ret; \
+} while (0)
+
#endif