diff options
| author | Daniel Glöckner <daniel-gl@gmx.net> | 2008-11-20 12:21:59 +0100 |
|---|---|---|
| committer | grischka <grischka> | 2008-11-30 07:21:46 +0100 |
| commit | 5fd6f7bd44b0d474a11cac9ae70b259f780331f4 (patch) | |
| tree | 831d7c05e6386f369668fe0c4911a0adc976510f /tcc.c | |
| parent | deb410710cc3f2128521dd37fdbd2bc0216a5e67 (diff) | |
| download | tinycc-5fd6f7bd44b0d474a11cac9ae70b259f780331f4.tar.gz tinycc-5fd6f7bd44b0d474a11cac9ae70b259f780331f4.tar.bz2 | |
Fix get_tok_str wrt wide characters
Fixes both, character constants and string literals.
Diffstat (limited to 'tcc.c')
| -rw-r--r-- | tcc.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1770,8 +1770,9 @@ char *get_tok_str(int v, CValue *cv) /* XXX: not quite exact, but only useful for testing */ sprintf(p, "%Lu", cv->ull); break; - case TOK_CCHAR: case TOK_LCHAR: + cstr_ccat(&cstr_buf, 'L'); + case TOK_CCHAR: cstr_ccat(&cstr_buf, '\''); add_char(&cstr_buf, cv->i); cstr_ccat(&cstr_buf, '\''); @@ -1784,8 +1785,9 @@ char *get_tok_str(int v, CValue *cv) add_char(&cstr_buf, ((unsigned char *)cstr->data)[i]); cstr_ccat(&cstr_buf, '\0'); break; - case TOK_STR: case TOK_LSTR: + cstr_ccat(&cstr_buf, 'L'); + case TOK_STR: cstr = cv->cstr; cstr_ccat(&cstr_buf, '\"'); if (v == TOK_STR) { |
