#ifdef V3_CONFIG_BUILT_IN_MEMMOVE
void * memmove(void * dst, const void * src, size_t n) {
uint8_t * tmp = (uint8_t *)V3_Malloc(n);
+
+ if (!tmp) {
+ PrintError(info->vm_info, info, "Cannot allocate in built-in memmove\n");
+ return NULL;
+ }
memcpy(tmp, src, n);
memcpy(dst, tmp, n);
char *ret;
ret = V3_Malloc(strlen(s1) + 1);
+
+ if (!ret) {
+ PrintError(VM_NONE, VCORE_NONE, "Cannot allocate in built-in strdup\n");
+ return NULL;
+ }
+
strcpy(ret, s1);
return ret;
#endif
+#ifdef V3_CONFIG_BUILT_IN_STRTOI
int strtoi(const char * nptr, char ** endptr) {
int ret = 0;
char * buf = (char *)nptr;
return ret;
}
+#endif
+#ifdef V3_CONFIG_BUILT_IN_ATOX
uint64_t atox(const char * buf) {
uint64_t ret = 0;
return ret;
}
+#endif
+#ifdef V3_CONFIG_BUILT_IN_STRTOX
uint64_t strtox(const char * nptr, char ** endptr) {
uint64_t ret = 0;
char * buf = (char *)nptr;
return ret;
}
-
+#endif
#ifdef V3_CONFIG_BUILT_IN_STRCHR
for (i = 0; i < reject_len; i++) {
if (s[cnt] == reject[i]) {
match = 1;
- cnt++;
break;
}
}
+
+ if (!match) {
+ cnt++;
+ }
+
}
return cnt;
}
#endif
-
+#ifdef V3_CONFIG_BUILT_IN_STR_TOLOWER
void str_tolower(char * s) {
while (isalpha(*s)) {
if (!islower(*s)) {
s++;
}
}
+#endif
-
+#ifdef V3_CONFIG_BUILT_IN_STR_TOUPPER
void str_toupper(char * s) {
while (isalpha(*s)) {
if (!isupper(*s)) {
s++;
}
}
+#endif