aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Woodward2005-01-06 19:31:12 +0000
committerJason Woodward2005-01-06 19:31:12 +0000
commit5b562bc1d3e751a1527923afdb4d3600443146c3 (patch)
tree502416fac5924b7b46f77e690ac771cc03e41ba2 /src
parent188cd9dbf358b3c671db38c7c4710275ccb995db (diff)
downloadslapt-get-5b562bc1d3e751a1527923afdb4d3600443146c3.tar.gz
fixed bug in gen_short_pkg_description with installed packages that are missing a description, triggered by the new --search functionality looking at installed packages
Diffstat (limited to 'src')
-rw-r--r--src/package.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/package.c b/src/package.c
index 1bd3770..21c7cae 100644
--- a/src/package.c
+++ b/src/package.c
@@ -410,7 +410,9 @@ char *gen_short_pkg_description(pkg_info_t *pkg){
char *short_description = NULL;
size_t string_size = 0;
- string_size = strlen(pkg->description) - (strlen(pkg->name) + 2) - strlen( strchr(pkg->description,'\n') );
+ if( strchr(pkg->description,'\n') != NULL ){
+ string_size = strlen(pkg->description) - (strlen(pkg->name) + 2) - strlen( strchr(pkg->description,'\n') );
+ }
/* quit now if the description is going to be empty */
if( (int)string_size < 0 ) return NULL;