1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-22 07:48:50 -05:00

Added a PKG_FULLNAME_LEN macro

This commit is contained in:
Aurelien Foret 2005-10-05 20:49:32 +00:00
parent d78bb4f37a
commit d7e781a54b
2 changed files with 3 additions and 2 deletions

View File

@ -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;

View File

@ -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