diff options
author | Siteshwar Vashisht <siteshwar@gmail.com> | 2012-03-13 05:39:17 +0530 |
---|---|---|
committer | Siteshwar Vashisht <siteshwar@gmail.com> | 2012-03-13 05:39:17 +0530 |
commit | dfe159e7192748bb03b0b58ef67f0a999c2bec82 (patch) | |
tree | 7450b19aa211ec7a266a7ee0dbf80abf250fc526 /common.cpp | |
parent | 4e7e45a43162dc64bfaa525d58e8f0193b483ce3 (diff) |
Fixed a crash on Linux caused while inserting \ in quotes.
Diffstat (limited to 'common.cpp')
-rw-r--r-- | common.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -1554,9 +1554,12 @@ wchar_t *unescape( const wchar_t * orig, int flags ) return 0; } else - out_pos--; + { + //We may ever escape a NULL character, but still appending a \ in case I am wrong. + in[out_pos] = L'\\'; + } } - + break; default: { in[out_pos++] = L'\\'; @@ -1610,9 +1613,12 @@ wchar_t *unescape( const wchar_t * orig, int flags ) return 0; } else - out_pos--; + { + //We probably don't need it since NULL character is always appended before ending this function. + in[out_pos]=in[in_pos]; + } } - + break; case '\\': case L'$': case '"': |