Kernel/vfs - Return matched flags from VFS_SelectNode
[tpg/acess2.git] / KernelLand / Kernel / libc.c
index c065e1e..fba3047 100644 (file)
@@ -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,10 +392,23 @@ 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--) {
-                               PUTCH(*p);
+                               if(*p == '\0') {
+                                       PUTCH('\\');
+                                       PUTCH('0');
+                               }
+                               else if(*p == '\\') {
+                                       PUTCH('\\');
+                                       PUTCH('\\');
+                               }
+                               else {
+                                       PUTCH(*p);
+                               }
                                p ++;
                        }
                        break;

UCC git Repository :: git.ucc.asn.au