aboutsummaryrefslogtreecommitdiff
path: root/fake-lib.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2017-05-18 06:46:55 +0100
committerSimon Tatham <anakin@pobox.com>2017-05-18 06:46:55 +0100
commit9e3e915426cb9ef8fd6f6689e12affb6288c5a8a (patch)
tree2da97d3419ee15fd0c0089d81d89bf74aeb26961 /fake-lib.c
parentca59ebf60df4ef45a1e4d681980e29e3db853bba (diff)
downloadwix-on-linux-9e3e915426cb9ef8fd6f6689e12affb6288c5a8a.tar.gz
wix-on-linux-9e3e915426cb9ef8fd6f6689e12affb6288c5a8a.tar.bz2
wix-on-linux-9e3e915426cb9ef8fd6f6689e12affb6288c5a8a.zip
Move snew/sfree out into their own header+src.
Diffstat (limited to 'fake-lib.c')
-rw-r--r--fake-lib.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/fake-lib.c b/fake-lib.c
index 011d35d..9862020 100644
--- a/fake-lib.c
+++ b/fake-lib.c
@@ -11,6 +11,7 @@
11#include <sys/wait.h> 11#include <sys/wait.h>
12#include <unistd.h> 12#include <unistd.h>
13 13
14#include "memory.h"
14#include "fake-lib.h" 15#include "fake-lib.h"
15 16
16char *ascii(const char16_t *wstr, bool translate_slashes) 17char *ascii(const char16_t *wstr, bool translate_slashes)
@@ -88,22 +89,6 @@ void c16cpy(char16_t *out, uint32_t *outsize, char *s)
88 *outsize = retlen; 89 *outsize = retlen;
89} 90}
90 91
91void *smalloc(size_t size)
92{
93 void *toret = malloc(size);
94 if (!toret)
95 errx(1, "out of memory");
96 return toret;
97}
98
99void *srealloc(void *ptr, size_t size)
100{
101 void *toret = realloc(ptr, size);
102 if (!toret)
103 errx(1, "out of memory");
104 return toret;
105}
106
107char *dupcat(const char *str, ...) 92char *dupcat(const char *str, ...)
108{ 93{
109 va_list ap; 94 va_list ap;