summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Beroset <beroset@mindspring.com>2004-12-15 23:32:57 +0000
committerEd Beroset <beroset@mindspring.com>2004-12-15 23:32:57 +0000
commit64ab51965a95a64ee863cdffdfbc8881dca4c53c (patch)
tree53952010e9134d9eee3110e62850ba3a4a6570b9
parenta5d2945b7b02d17f52fcebf6b52ec2da2ba995c2 (diff)
downloadnasm-64ab51965a95a64ee863cdffdfbc8881dca4c53c.tar.gz
Added todo item to point out the somewhat tricky fact about snprintf's
return value.
-rw-r--r--disasm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/disasm.c b/disasm.c
index 79837114..dd806d6f 100644
--- a/disasm.c
+++ b/disasm.c
@@ -582,6 +582,13 @@ long disasm (unsigned char *data, char *output, int outbufsize, int segsize,
slen = 0;
+ /* TODO: snprintf returns the value that the string would have if
+ * the buffer were long enough, and not the actual length of
+ * the returned string, so each instance of using the return
+ * value of snprintf should actually be checked to assure that
+ * the return value is "sane." Maybe a macro wrapper could
+ * be used for that purpose.
+ */
if (lock)
slen += snprintf(output+slen, outbufsize-slen, "lock ");
for (i = 0; i < ins.nprefix; i++)