chiark
/
gitweb
/
~ian
/
userv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Server checks itself every hour, and logs with pid.
[userv.git]
/
lib.c
diff --git
a/lib.c
b/lib.c
index 6c3cd0aff62924cd3e98449ae30616b54ce164a4..e36382927e158d007eed9bdbb13a3246c73f8f97 100644
(file)
--- a/
lib.c
+++ b/
lib.c
@@
-25,8
+25,10
@@
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
+#include <sys/types.h>
#include "config.h"
#include "config.h"
+#include "common.h"
#include "lib.h"
char *xstrcat3save(const char *a, const char *b, const char *c) {
#include "lib.h"
char *xstrcat3save(const char *a, const char *b, const char *c) {
@@
-67,10
+69,12
@@
void *xrealloc(void *p, size_t s) {
return p;
}
return p;
}
-void makeroom(char **buffer, int *size, int needed) {
- if (*size >= needed) return;
+int makeroom(char **buffer, int *size, int needed) {
+ if (needed > MAX_GENERAL_STRING) return -1;
+ if (*size >= needed) return 0;
*buffer= xrealloc(*buffer,needed);
*size= needed;
*buffer= xrealloc(*buffer,needed);
*size= needed;
+ return 0;
}
void vsnyprintf(char *buffer, size_t size, const char *fmt, va_list al) {
}
void vsnyprintf(char *buffer, size_t size, const char *fmt, va_list al) {