X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Flibc.c;h=fba304799c64e7021e8a05f5a705fc5855a977dd;hb=87e4d6f72ec0c006b60eecd1364ed26e48002c99;hp=d42e5249e34289df90482f50b4094232e48274b7;hpb=ac32205b722276a0e7502e3ab003171f852341de;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/libc.c b/KernelLand/Kernel/libc.c index d42e5249..fba30479 100644 --- a/KernelLand/Kernel/libc.c +++ b/KernelLand/Kernel/libc.c @@ -74,6 +74,7 @@ EXPORT(CheckMem); // === CODE === // - Import userland stroi.c file #define _LIB_H_ +#define _SysDebug(f,v...) Log_Debug("libc", f ,## v) #include "../../Usermode/Libraries/libc.so_src/strtoi.c" int ParseInt(const char *string, int *Val) @@ -391,13 +392,20 @@ int vsnprintf(char *__s, const size_t __maxlen, const char *__format, va_list ar case 'C': // Non-Null Terminated Character Array p = va_arg(args, char*); - if( !CheckMem(p, minSize) ) continue; // No #PFs please + if( !CheckMem(p, minSize) ) { + p = "(inval)"; + goto printString; + } if(!p) goto printString; while(minSize--) { if(*p == '\0') { PUTCH('\\'); PUTCH('0'); } + else if(*p == '\\') { + PUTCH('\\'); + PUTCH('\\'); + } else { PUTCH(*p); }