mirror of
https://github.com/Decompollaborate/rabbitizer.git
synced 2025-01-01 00:17:32 +00:00
Escape \
-> \\
This commit is contained in:
parent
9bf973e82d
commit
026c78df76
@ -31,6 +31,7 @@ size_t RabbitizerUtils_escapeString(char *dst, size_t dstSize, const char *src,
|
||||
size_t dstpos = 0;
|
||||
|
||||
for (; srcPos < srcSize && dstpos < dstSize; srcPos++, src++) {
|
||||
// The cases of this switch are sorted by ASCII order
|
||||
switch (*src) {
|
||||
case '\a':
|
||||
RABUTILS_BUFFER_WRITE_CHAR(dst, dstpos, '\\');
|
||||
@ -62,6 +63,11 @@ size_t RabbitizerUtils_escapeString(char *dst, size_t dstSize, const char *src,
|
||||
RABUTILS_BUFFER_WRITE_CHAR(dst, dstpos, '"');
|
||||
break;
|
||||
|
||||
case '\\':
|
||||
RABUTILS_BUFFER_WRITE_CHAR(dst, dstpos, '\\');
|
||||
RABUTILS_BUFFER_WRITE_CHAR(dst, dstpos, '\\');
|
||||
break;
|
||||
|
||||
default:
|
||||
RABUTILS_BUFFER_WRITE_CHAR(dst, dstpos, *src);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user