aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/library.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/library.js b/src/library.js
index f958a436..151cf3e5 100644
--- a/src/library.js
+++ b/src/library.js
@@ -4657,6 +4657,14 @@ LibraryManager.library = {
return 0;
},
+ strnlen: function(ptr, num) {
+ for (var i = 0; i < num; i++) {
+ if ({{{ makeGetValue('ptr', 0, 'i8') }}} == 0) return i;
+ ptr++;
+ }
+ return num;
+ },
+
strstr: function(ptr1, ptr2) {
var check = 0, start;
do {