int DivUp(int num, int dem);
Sint64 timestamp(int sec, int mins, int hrs, int day, int month, int year);
-Uint rand(void);
+ int rand(void);
int CheckString(char *String);
int CheckMem(void *Mem, int NumBytes);
itoa(p, val, 10, minSize, pad);
goto printString;
case 'X':
- #if BITS == 64
- isLongLong = 1; // TODO: Handle non-x86 64-bit archs
- #endif
+ if(BITS == 64)
+ isLongLong = 1; // TODO: Handle non-x86 64-bit archs
GETVAL();
itoa(p, val, 16, minSize, pad);
goto printString;
// String - Null Terminated Array
case 's':
p = va_arg(args, char*); // Get Argument
+ if( !CheckString(p) ) continue; // Avoid #PFs
printString:
if(!p) p = "(null)";
len = strlen(p);
case 'C': // Non-Null Terminated Character Array
p = va_arg(args, char*);
+ if( !CheckMem(p, minSize) ) continue; // No #PFs please
if(!p) goto printString;
while(minSize--) PUTCH(*p++);
break;
}
/**
- * \fn Uint strlen(const char *__str)
+ * \fn size_t strlen(const char *__str)
* \brief Get the length of string
*/
-Uint strlen(const char *__str)
+size_t strlen(const char *__str)
{
- Uint ret = 0;
+ size_t ret = 0;
while(*__str++) ret++;
return ret;
}
}
/**
- * \fn Uint rand()
+ * \fn int rand()
* \brief Pseudo random number generator
- * \note Unknown effectiveness (made up on the spot)
*/
-Uint rand(void)
+int rand(void)
{
#if 0
static Uint state = RANDOM_SEED;