1. Amr Hassan
  2. libsqlite3pp

Commits

Amr Hassan  committed 75d7d66

Fixed string escaping of two single quotes

  • Participants
  • Parent commits 8d3e2b5
  • Branches default
  • Tags libsqlite3pp-0.3.4

Comments (0)

Files changed (1)

File src/rogue.cpp

View file
 	std::string output(string);
 
 	for (std::size_t i = 0; i < output.size(); i++) {
-		if (output[i] == '\'' && output[i+1] != '\'') {
-			output.replace(i++, 1, "''");
+		if (output[i] == '\'') {
+			output.insert(i, 1, '\'');
+			i++;
 		}
 	}