summaryrefslogtreecommitdiffstats
path: root/src/pacman/util.h
diff options
context:
space:
mode:
authorJudd Vinet <judd@archlinux.org>2005-12-21 00:59:56 +0100
committerJudd Vinet <judd@archlinux.org>2005-12-21 00:59:56 +0100
commita074ddb85b4d1f9b90842e5a4f15e2416e3147fe (patch)
treeb57342bd634884d7bb7679eb02e46bedfb2b6708 /src/pacman/util.h
parent953e7e5d3eea5d4562a8b4cf2cb18d4a71a96ff9 (diff)
downloadpacman-a074ddb85b4d1f9b90842e5a4f15e2416e3147fe.tar.gz
pacman-a074ddb85b4d1f9b90842e5a4f15e2416e3147fe.tar.xz
VMiklos: add STRNCPY macro from alpm to pacman
Diffstat (limited to 'src/pacman/util.h')
-rw-r--r--src/pacman/util.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pacman/util.h b/src/pacman/util.h
index 755f0b96..d48303c0 100644
--- a/src/pacman/util.h
+++ b/src/pacman/util.h
@@ -28,6 +28,11 @@
#define FREE(p) do { if (p) { free(p); (p) = NULL; }} while(0)
+#define STRNCPY(s1, s2, len) do { \
+ strncpy(s1, s2, (len)-1); \
+ s1[(len)-1] = 0; \
+} while(0)
+
int makepath(char *path);
int rmrf(char *path);
void indentprint(char *str, int indent);