chiark / gitweb /
www-cgi/: Move `xrealloc' to `ucgicommon'.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 29 Jan 2013 23:53:55 +0000 (23:53 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 30 Jan 2013 00:42:17 +0000 (00:42 +0000)
Both programs will want it soon enough.

www-cgi/ucgi.h
www-cgi/ucgicommon.c
www-cgi/ucgitarget.c

index 59153210f3300cce80177188a17c62befe60980d..5a51a7710de005a7aae4396241a71f0e0d9637ea 100644 (file)
@@ -32,6 +32,7 @@ void syserror(const char *m);
 void error(const char *m);
 void *xmalloc(size_t sz);
 void xsetenv(const char *en, const char *ev, int overwrite);
 void error(const char *m);
 void *xmalloc(size_t sz);
 void xsetenv(const char *en, const char *ev, int overwrite);
+void *xrealloc(void *ptr, size_t sz);
 
 extern const char *const envok[];
 extern const int nenvok;
 
 extern const char *const envok[];
 extern const int nenvok;
index 4a8749a017eebd3c5b30db3b4d2289df913f2181..43b7d945aa439ea36ef54ada5bd8534716fd0d00 100644 (file)
@@ -103,6 +103,14 @@ void *xmalloc(size_t sz) {
   return r;
 }
 
   return r;
 }
 
+void *xrealloc(void *ptr, size_t sz) {
+  void *r;
+
+  r= realloc(ptr,sz);
+  if (!r) syserror("realloc failed");
+  return r;
+}
+
 void xsetenv(const char *en, const char *ev, int overwrite) {
   if (setenv(en,ev,overwrite)) syserror("setenv");
 }
 void xsetenv(const char *en, const char *ev, int overwrite) {
   if (setenv(en,ev,overwrite)) syserror("setenv");
 }
index 4228951b2643ec08f21bb3dd33fde7fdd9fa000b..e38ad3050aef312c72b2c6dc56cdceb95505ef25 100644 (file)
 
 #include "ucgi.h"
 
 
 #include "ucgi.h"
 
-static void *xrealloc(void *ptr, size_t sz) {
-  void *r;
-
-  r= realloc(ptr,sz);
-  if (!r) syserror("realloc failed");
-  return r;
-}
-
 int main(int argc, const char **argv) {
   char *uservarn, *scriptpath, *newvar;
   const char *nextslash, *lastslash, *pathi, *ev, *ev2, *en, *scriptdir, *av;
 int main(int argc, const char **argv) {
   char *uservarn, *scriptpath, *newvar;
   const char *nextslash, *lastslash, *pathi, *ev, *ev2, *en, *scriptdir, *av;