diff options
author | YamaArashi <shadow962@live.com> | 2016-05-15 07:08:39 -0700 |
---|---|---|
committer | YamaArashi <shadow962@live.com> | 2016-05-15 07:08:39 -0700 |
commit | 91c4c96fe991b9a5c3aff6af3f1d4cb715b89c5c (patch) | |
tree | f69626c30173576a604d4bd04d034bb5ef8a0e9d /tools/preproc/preproc.cpp | |
parent | eaa9f37ca97c1c546fa3386d4389a45ebbc60b18 (diff) |
allow multiple symbols/integers inside curly brackets in preproc
Diffstat (limited to 'tools/preproc/preproc.cpp')
-rw-r--r-- | tools/preproc/preproc.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/tools/preproc/preproc.cpp b/tools/preproc/preproc.cpp index 7fc3f5c10..4f216f23a 100644 --- a/tools/preproc/preproc.cpp +++ b/tools/preproc/preproc.cpp @@ -64,15 +64,18 @@ int main(int argc, char **argv) unsigned char s[kMaxStringLength]; int length = stack.top().ReadString(s); - printf("\t.byte "); - for (int i = 0; i < length; i++) + if (length > 0) { - printf("0x%02X", s[i]); + printf("\t.byte "); + for (int i = 0; i < length; i++) + { + printf("0x%02X", s[i]); - if (i < length - 1) - printf(", "); + if (i < length - 1) + printf(", "); + } + putchar('\n'); } - putchar('\n'); break; } case Directive::Unknown: |