diff options
author | Ed Beroset <beroset@mindspring.com> | 2004-12-15 23:32:57 +0000 |
---|---|---|
committer | Ed Beroset <beroset@mindspring.com> | 2004-12-15 23:32:57 +0000 |
commit | 64ab51965a95a64ee863cdffdfbc8881dca4c53c (patch) | |
tree | 53952010e9134d9eee3110e62850ba3a4a6570b9 | |
parent | a5d2945b7b02d17f52fcebf6b52ec2da2ba995c2 (diff) | |
download | nasm-64ab51965a95a64ee863cdffdfbc8881dca4c53c.tar.gz |
Added todo item to point out the somewhat tricky fact about snprintf's
return value.
-rw-r--r-- | disasm.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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++) |