chiark / gitweb /
Upgrade licence to GPLv3+.
[userv.git] / lib.c
diff --git a/lib.c b/lib.c
index 22c8cd1750a52af1855b242104191d6abb3028a1..a4b6f154575fcfea65216d58bd06f0d5cdbecaab 100644 (file)
--- a/lib.c
+++ b/lib.c
@@ -2,11 +2,14 @@
  * userv - lib.c
  * useful utility routines, used in daemon, but not very dependent on it
  *
- * Copyright (C)1996-1997,1999 Ian Jackson
+ * userv is
+ * Copyright 1996-2017 Ian Jackson <ian@davenant.greenend.org.uk>.
+ * Copyright 2000      Ben Harris <bjh21@cam.ac.uk>
+ * Copyright 2016-2017 Peter Benie <pjb1008@cam.ac.uk>
  *
  * This is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful, but
@@ -15,8 +18,7 @@
  * General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with userv; if not, write to the Free Software
- * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * along with userv; if not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <errno.h>
@@ -31,6 +33,7 @@
 #include "config.h"
 #include "common.h"
 #include "lib.h"
+#include "both.h"
 
 char *xstrcat3save(const char *a, const char *b, const char *c) {
   char *r;
@@ -42,14 +45,6 @@ char *xstrcat3save(const char *a, const char *b, const char *c) {
   return r;
 }
 
-char *xstrsave(const char *s) {
-  char *r;
-
-  r= xmalloc(strlen(s)+1);
-  strcpy(r,s);
-  return r;
-}
-
 char *xstrsubsave(const char *begin, int len) {
   char *r;
   
@@ -59,17 +54,6 @@ char *xstrsubsave(const char *begin, int len) {
   return r;
 }
 
-void *xmalloc(size_t s) {
-  void *p;
-  p= malloc(s?s:1); if (!p) syscallerror("malloc");
-  return p;
-}
-
-void *xrealloc(void *p, size_t s) {
-  p= realloc(p,s); if (!p) syscallerror("realloc");
-  return p;
-}
-
 int makeroom(char **buffer, int *size, int needed) {
   if (needed > MAX_GENERAL_STRING) return -1;
   if (*size >= needed) return 0;