]> git.tdb.fi Git - libs/core.git/blobdiff - source/utils.cpp
Fix octal escape generation in c_escape
[libs/core.git] / source / utils.cpp
index baf1333138b82807864df7bb1f04ebc7365e3f33..c2bafb9b85527c9b570dea735588397900f4f6ca 100644 (file)
@@ -301,7 +301,7 @@ string c_escape(const string &str, bool escape_8bit)
                        result+="\\\\";
                else if(static_cast<unsigned char>(*i)<' ' || (escape_8bit && (*i&0x80)))
                {
-                       char buf[4]={'\\', '0'+((*i>>6)&7), '0'+((*i>>3)&7), '0'+(*i&7)};
+                       char buf[4]={'\\', '0'+((*i>>6)&3), '0'+((*i>>3)&7), '0'+(*i&7)};
                        result.append(buf, 4);
                }
                else