diff options
author | Aurelien Foret <aurelien@archlinux.org> | 2005-10-05 22:49:32 +0200 |
---|---|---|
committer | Aurelien Foret <aurelien@archlinux.org> | 2005-10-05 22:49:32 +0200 |
commit | d7e781a54bc8aad793abd51fdb5f8f1c7cdae7ad (patch) | |
tree | 29ee876df87762e7ae7313ee962b39ea604b6250 /lib | |
parent | d78bb4f37ae58c55a72b5d52f030eb64fa6d6e75 (diff) | |
download | pacman-d7e781a54bc8aad793abd51fdb5f8f1c7cdae7ad.tar.gz pacman-d7e781a54bc8aad793abd51fdb5f8f1c7cdae7ad.tar.xz |
Added a PKG_FULLNAME_LEN macro
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libalpm/package.c | 4 | ||||
-rw-r--r-- | lib/libalpm/package.h | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index bf64a481..3b0669fc 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -372,7 +372,7 @@ int pkg_isin(pmpkg_t *needle, PMList *haystack) int pkg_splitname(char *target, char *name, char *version) { - char tmp[(PKG_NAME_LEN-1)+1+(PKG_VERSION_LEN-1)+7+1]; + char tmp[PKG_FULLNAME_LEN+7]; char *p, *q; if(target == NULL) { @@ -385,7 +385,7 @@ int pkg_splitname(char *target, char *name, char *version) } else { p++; } - STRNCPY(tmp, p, (PKG_NAME_LEN-1)+1+(PKG_VERSION_LEN-1)+7+1); + STRNCPY(tmp, p, PKG_FULLNAME_LEN+7); /* trim file extension (if any) */ if((p = strstr(tmp, PM_EXT_PKG))) { *p = 0; diff --git a/lib/libalpm/package.h b/lib/libalpm/package.h index a5b39b77..a6b8b224 100644 --- a/lib/libalpm/package.h +++ b/lib/libalpm/package.h @@ -30,6 +30,7 @@ enum { #define PKG_NAME_LEN 256 #define PKG_VERSION_LEN 64 +#define PKG_FULLNAME_LEN (PKG_NAME_LEN-1)+1+(PKG_VERSION_LEN-1)+1 #define PKG_DESC_LEN 512 #define PKG_URL_LEN 256 #define PKG_DATE_LEN 32 |