diff options
Diffstat (limited to 'archival/dpkg.c')
-rw-r--r-- | archival/dpkg.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/archival/dpkg.c b/archival/dpkg.c index 4d0f3fbf3..2f7372100 100644 --- a/archival/dpkg.c +++ b/archival/dpkg.c | |||
@@ -711,7 +711,7 @@ static unsigned int get_status(const unsigned int status_node, const int num) | |||
711 | /* skip past the separating spaces */ | 711 | /* skip past the separating spaces */ |
712 | status_string += strspn(status_string, " "); | 712 | status_string += strspn(status_string, " "); |
713 | } | 713 | } |
714 | len = strcspn(status_string, " \n\0"); | 714 | len = strcspn(status_string, " \n"); |
715 | state_sub_string = xstrndup(status_string, len); | 715 | state_sub_string = xstrndup(status_string, len); |
716 | state_sub_num = search_name_hashtable(state_sub_string); | 716 | state_sub_num = search_name_hashtable(state_sub_string); |
717 | free(state_sub_string); | 717 | free(state_sub_string); |
@@ -796,7 +796,7 @@ static void index_status_file(const char *filename) | |||
796 | if (status_line != NULL) { | 796 | if (status_line != NULL) { |
797 | status_line += 7; | 797 | status_line += 7; |
798 | status_line += strspn(status_line, " \n\t"); | 798 | status_line += strspn(status_line, " \n\t"); |
799 | status_line = xstrndup(status_line, strcspn(status_line, "\n\0")); | 799 | status_line = xstrndup(status_line, strcspn(status_line, "\n")); |
800 | status_node->status = search_name_hashtable(status_line); | 800 | status_node->status = search_name_hashtable(status_line); |
801 | free(status_line); | 801 | free(status_line); |
802 | } | 802 | } |
@@ -849,7 +849,7 @@ static void write_status_file(deb_file_t **deb_file) | |||
849 | 849 | ||
850 | tmp_string += 8; | 850 | tmp_string += 8; |
851 | tmp_string += strspn(tmp_string, " \n\t"); | 851 | tmp_string += strspn(tmp_string, " \n\t"); |
852 | package_name = xstrndup(tmp_string, strcspn(tmp_string, "\n\0")); | 852 | package_name = xstrndup(tmp_string, strcspn(tmp_string, "\n")); |
853 | write_flag = FALSE; | 853 | write_flag = FALSE; |
854 | tmp_string = strstr(control_buffer, "Status:"); | 854 | tmp_string = strstr(control_buffer, "Status:"); |
855 | if (tmp_string != NULL) { | 855 | if (tmp_string != NULL) { |
@@ -1374,8 +1374,8 @@ static void remove_package(const unsigned int package_num, int noisy) | |||
1374 | sprintf(conffile_name, "/var/lib/dpkg/info/%s.conffiles", package_name); | 1374 | sprintf(conffile_name, "/var/lib/dpkg/info/%s.conffiles", package_name); |
1375 | exclude_files = create_list(conffile_name); | 1375 | exclude_files = create_list(conffile_name); |
1376 | 1376 | ||
1377 | /* Some directories cant be removed straight away, so do multiple passes */ | 1377 | /* Some directories can't be removed straight away, so do multiple passes */ |
1378 | while (remove_file_array(remove_files, exclude_files)); | 1378 | while (remove_file_array(remove_files, exclude_files)) /*repeat */; |
1379 | free_array(exclude_files); | 1379 | free_array(exclude_files); |
1380 | free_array(remove_files); | 1380 | free_array(remove_files); |
1381 | 1381 | ||
@@ -1421,7 +1421,7 @@ static void purge_package(const unsigned int package_num) | |||
1421 | exclude_files = xzalloc(sizeof(char*)); | 1421 | exclude_files = xzalloc(sizeof(char*)); |
1422 | 1422 | ||
1423 | /* Some directories cant be removed straight away, so do multiple passes */ | 1423 | /* Some directories cant be removed straight away, so do multiple passes */ |
1424 | while (remove_file_array(remove_files, exclude_files)); | 1424 | while (remove_file_array(remove_files, exclude_files)) /* repeat */; |
1425 | free_array(remove_files); | 1425 | free_array(remove_files); |
1426 | 1426 | ||
1427 | /* Create a list of all /var/lib/dpkg/info/<package> files */ | 1427 | /* Create a list of all /var/lib/dpkg/info/<package> files */ |