added Result struct
This commit is contained in:
10
src/errors.c
Executable file
10
src/errors.c
Executable file
@@ -0,0 +1,10 @@
|
||||
#include "tlibc/errors.h"
|
||||
|
||||
#define ERRMSG_LENGTH 1024
|
||||
|
||||
char* _genErrorMessage(cstr file, i32 line, cstr func, char* msg, bool free_msg){
|
||||
char* result = sprintf_malloc(1024, "[%s:%i] %s() throwed error: %s", file, line, func, msg);
|
||||
if(free_msg)
|
||||
free(msg);
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user