-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Unlike implementations of string functions like strlen(const char*), some langcraft built-in functions require a length parameter. For example:
extern void insert_asm(const char* cmd,int len,int arg);
int main() {
insert_asm("kill @e",7,0);
}
C strings are null-terminated, or contain a '\0' character to signify the end of a string. Implementations of string functions generally look for the null character to determine a string's length.
I'm not certain why langcraft doesn't do this. Could langcraft determine the end of a string with '\0'?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels