len = vsnprintf(NULL, 0, f_copy, a_copy);
va_end(a_copy);
- len += 1;
+ len += 2;
char buf[len];
memset(buf, 0, len);
return d;
}
+
// A function to turn a process into a daemon and set it's process name in ps/top
int daemonize() {
int f = fork();
}
}
+int stringisnum(char* s) {
+ char* w = (char*) malloc(strlen(s) * sizeof(char*));
+ bzero(w, strlen(s));
+ long blah = strtol(s, &w, 10);
+ if(strlen(w) > 0)
+ return 0;
+ return 1;
+}
+
double get_timestamp_millis();
+/* returns true if the whole string is a number */
+int stringisnum(char* s);
+
+
#endif