@deprecated
(string, buffer, dontAddNull)
| 1302 | // to be secure from out of bounds writes. |
| 1303 | /** @deprecated */ |
| 1304 | function writeStringToMemory(string, buffer, dontAddNull) { |
| 1305 | warnOnce('writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!'); |
| 1306 | |
| 1307 | var /** @type {number} */ lastChar, /** @type {number} */ end; |
| 1308 | if (dontAddNull) { |
| 1309 | // stringToUTF8Array always appends null. If we don't want to do that, remember the |
| 1310 | // character that existed at the location where the null will be placed, and restore |
| 1311 | // that after the write (below). |
| 1312 | end = buffer + lengthBytesUTF8(string); |
| 1313 | lastChar = HEAP8[end]; |
| 1314 | } |
| 1315 | stringToUTF8(string, buffer, Infinity); |
| 1316 | if (dontAddNull) HEAP8[end] = lastChar; // Restore the value under the null character. |
| 1317 | } |
| 1318 | |
| 1319 | |
| 1320 | function writeArrayToMemory(array, buffer) { |
no test coverage detected
searching dependent graphs…