aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/auth/secstore/util.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-02-13 05:59:29 +0000
committerrsc <devnull@localhost>2005-02-13 05:59:29 +0000
commit6e527fbc4d8f404a7eec934e5c9efaaaa92ffdff (patch)
tree4d9ed63c88e5a8dd8a4d5bd3582e7d5e6a24065f /src/cmd/auth/secstore/util.c
parent0f8ec41b0ae522b73085fa1662461e6351ba7e54 (diff)
downloadplan9port-6e527fbc4d8f404a7eec934e5c9efaaaa92ffdff.tar.gz
plan9port-6e527fbc4d8f404a7eec934e5c9efaaaa92ffdff.tar.bz2
plan9port-6e527fbc4d8f404a7eec934e5c9efaaaa92ffdff.zip
new auth
Diffstat (limited to 'src/cmd/auth/secstore/util.c')
-rw-r--r--src/cmd/auth/secstore/util.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/cmd/auth/secstore/util.c b/src/cmd/auth/secstore/util.c
new file mode 100644
index 00000000..ebbb12df
--- /dev/null
+++ b/src/cmd/auth/secstore/util.c
@@ -0,0 +1,28 @@
+#include <u.h>
+#include <libc.h>
+
+void *
+emalloc(ulong n)
+{
+ void *p = malloc(n);
+ if(p == nil)
+ sysfatal("emalloc");
+ memset(p, 0, n);
+ return p;
+}
+
+void *
+erealloc(void *p, ulong n)
+{
+ if ((p = realloc(p, n)) == nil)
+ sysfatal("erealloc");
+ return p;
+}
+
+char *
+estrdup(char *s)
+{
+ if ((s = strdup(s)) == nil)
+ sysfatal("estrdup");
+ return s;
+}