aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2018-11-25 23:13:47 +0100
committerMattias Andrée <maandree@kth.se>2018-11-25 23:13:47 +0100
commitce7ce1b948733084e16fb133ec47d622a67dcf61 (patch)
treed0c6fd3371f5166cf35b88a63cb13966e94ac45c
parentSome fixes and add wide-character string duplication functions (diff)
downloadlibsimple-ce7ce1b948733084e16fb133ec47d622a67dcf61.tar.gz
libsimple-ce7ce1b948733084e16fb133ec47d622a67dcf61.tar.bz2
libsimple-ce7ce1b948733084e16fb133ec47d622a67dcf61.tar.xz
m
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--libsimple/aligned_wcsndup.h2
-rw-r--r--libsimple/wcsndup.h2
-rw-r--r--wcsndup.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/libsimple/aligned_wcsndup.h b/libsimple/aligned_wcsndup.h
index 3378181..b75f661 100644
--- a/libsimple/aligned_wcsndup.h
+++ b/libsimple/aligned_wcsndup.h
@@ -23,7 +23,7 @@
if (__misalignment)\
__r += (uintptr_t)__a - __misalignment;\
wmemcpy(__r, __s, __n);\
- __r[__n] = '\0';\
+ __r[__n] = 0;\
__r;\
})
# ifndef aligned_wcsndupa
diff --git a/libsimple/wcsndup.h b/libsimple/wcsndup.h
index 0f00d9e..399b5e5 100644
--- a/libsimple/wcsndup.h
+++ b/libsimple/wcsndup.h
@@ -16,7 +16,7 @@
wchar_t *__r;\
__r = alloca((__n + 1) * sizeof(wchar_t));\
wmemcpy(__r, __s, __n);\
- __r[__n] = '\0';\
+ __r[__n] = 0;\
__r;\
})
# ifndef wcsndupa
diff --git a/wcsndup.c b/wcsndup.c
index 83e227d..ba4e009 100644
--- a/wcsndup.c
+++ b/wcsndup.c
@@ -16,7 +16,7 @@ libsimple_wcsndup(const wchar_t *s, size_t n) /* TODO test */
if (!ret)
enprintf(status, "wcsdup:");
wmemcpy(ret, s, n);
- ret[n] = '\0';
+ ret[n] = 0;
return ret;
}