Quellcode durchsuchen

Ensure static path sizes don't break

Or rather, notify us if they do.
Lucas Stadler vor 9 Jahren
Ursprung
Commit
e3a80a016f
1 geänderte Dateien mit 2 neuen und 0 gelöschten Zeilen
  1. 2 0
      c/ton/main.c

+ 2 - 0
c/ton/main.c

@ -86,6 +86,7 @@ JSValueRef function_read_file(JSContextRef ctx, JSObjectRef function, JSObjectRe
86 86
	if (argc == 1 && JSValueGetType(ctx, args[0]) == kJSTypeString) {
87 87
		char path[100];
88 88
		JSStringRef path_str = JSValueToStringCopy(ctx, args[0], NULL);
89
		assert(JSStringGetLength(path_str) < 100);
89 90
		JSStringGetUTF8CString(path_str, path, 100);
90 91
		JSStringRelease(path_str);
91 92
@ -118,6 +119,7 @@ JSValueRef function_load(JSContextRef ctx, JSObjectRef function, JSObjectRef thi
118 119
	if (argc == 1 && JSValueGetType(ctx, args[0]) == kJSTypeString) {
119 120
		char path[100];
120 121
		JSStringRef path_str = JSValueToStringCopy(ctx, args[0], NULL);
122
		assert(JSStringGetLength(path_str) < 100);
121 123
		JSStringGetUTF8CString(path_str, path, 100);
122 124
		JSStringRelease(path_str);
123 125