Browse Source

Forgot to add "\t" to compute the space to allocate the buffer.

mingodad 11 years ago
parent
commit
b295d2b9dd
1 changed files with 2 additions and 2 deletions
  1. 2 2
      SquiLu/sqstdlib/sqstdstring.cpp

+ 2 - 2
SquiLu/sqstdlib/sqstdstring.cpp

@@ -109,7 +109,7 @@ SQRESULT sqstd_format(HSQUIRRELVM v,SQInteger nformatstringidx,SQInteger *outlen
                           ++addlen;
                           ++ts2; --size;//eat \r and output only \n
                         }
-                        else if (*ts2 == _SC('"') || *ts2 == _SC('\\') || *ts2 == _SC('\n')) {
+                        else if (*ts2 == _SC('"') || *ts2 == _SC('\\') || *ts2 == _SC('\n')  || *ts2 == _SC('\t')) {
                           ++addlen;
                         }
                         else if (*ts2 == _SC('\0') || iscntrl(uchar(*ts2))) {
@@ -129,7 +129,7 @@ SQRESULT sqstd_format(HSQUIRRELVM v,SQInteger nformatstringidx,SQInteger *outlen
                       *ts2++ = _SC('"');
                       while (size--) {
                         if (*ts == _SC('\r') && *(ts+1) == _SC('\n') ) {
-                          ++ts; --size;//eat \r and output only \n
+                          ++ts;//eat \r and output only \n
                         }
                         if (*ts == _SC('"') || *ts == _SC('\\')) {
                             *ts2++ = _SC('\\');