- Timestamp:
- May 6, 2014, 10:24:12 AM (11 years ago)
- Location:
- branches/3.2/mondo/src/common
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mondo/src/common/libmondo-archive.c
r3281 r3288 1416 1416 retval += res; 1417 1417 g_current_progress++; 1418 m r_asprintf(media_usage_comment, "%s", percent_media_full_comment());1418 media_usage_comment = percent_media_full_comment(); 1419 1419 update_progress_form(media_usage_comment); 1420 1420 mr_free(media_usage_comment); … … 2170 2170 g_current_progress++; 2171 2171 2172 m r_asprintf(media_usage_comment, "%s", percent_media_full_comment());2172 media_usage_comment = percent_media_full_comment(); 2173 2173 update_progress_form(media_usage_comment); 2174 2174 mr_free(media_usage_comment); … … 2893 2893 mr_asprintf(curr_slice_fname_compressed, "%s", slice_fname(biggie_file_number, slice_num, bkpinfo->tmpdir, suffix)); 2894 2894 2895 mr_asprintf(tmp, "%s", percent_media_full_comment());2895 tmp = percent_media_full_comment(); 2896 2896 update_progress_form(tmp); 2897 2897 mr_free(tmp); -
branches/3.2/mondo/src/common/libmondo-devices.c
r3278 r3288 1687 1687 int c = 0; 1688 1688 int lastpos = 0; 1689 char VG[MAX_STR_LEN];1689 char *VG = NULL; 1690 1690 char *tmp = NULL; 1691 1691 char *command = NULL; … … 1849 1849 mr_asprintf(command, "pvdisplay -v %s 2>/dev/null|grep \"VG Name\"|awk '{print $NF}'", partitions[i]); 1850 1850 log_msg(5, " Running: %s", command); 1851 strcpy(VG, call_program_and_get_last_line_of_output(command));1851 mr_asprintf(VG, "%s", call_program_and_get_last_line_of_output(command)); 1852 1852 mr_free(command); 1853 1853 … … 1912 1912 } 1913 1913 mr_free(tmp); 1914 mr_free(VG); 1914 1915 continue; 1915 1916 } else { -
branches/3.2/mondo/src/common/libmondo-string.c
r3205 r3288 472 472 * @param value The value to replace @p token. 473 473 */ 474 475 /* TODO: consider mr_strtok */ 474 476 void resolve_naff_tokens(char *output, char *ip, char *value, char *token) 475 477 { … … 1020 1022 /*@ int *********************************************** */ 1021 1023 int percentage; 1022 int j;1023 1024 1024 1025 /*@ buffers ******************************************* */ 1025 static char outstr[MAX_STR_LEN];1026 char * outstr = NULL; 1026 1027 char *pos_w_commas = NULL; 1027 1028 char *mds = NULL; … … 1034 1035 mr_asprintf(pos_w_commas, "%s", commarize(tmp)); 1035 1036 mr_free(tmp); 1036 sprintf(outstr, "Volume %d: %s kilobytes archived so far", g_current_media_number, pos_w_commas);1037 mr_asprintf(outstr, "Volume %d: %s kilobytes archived so far", g_current_media_number, pos_w_commas); 1037 1038 mr_free(pos_w_commas); 1038 1039 return (outstr); … … 1045 1046 percentage = 100; 1046 1047 } 1047 sprintf(outstr, "Volume %d: [", g_current_media_number);1048 mr_asprintf(outstr, "Volume %d: [", g_current_media_number); 1048 1049 } else { 1049 1050 percentage = (int) (space_occupied_by_cd(bkpinfo->scratchdir) * 100 / 1024 / bkpinfo->media_size); 1050 1051 mds = media_descriptor_string(bkpinfo->backup_media_type); 1051 sprintf(outstr, "%s %d: [", mds, g_current_media_number);1052 mr_asprintf(outstr, "%s %d: [", mds, g_current_media_number); 1052 1053 mr_free(mds); 1053 1054 } 1054 1055 for (j = 0; j < percentage; j += 5) { 1055 strcat(outstr, "*");1056 mr_strcat(outstr, "*"); 1056 1057 } 1057 1058 for (; j < 100; j += 5) { 1058 strcat(outstr, "."); 1059 } 1060 j = (int) strlen(outstr); 1061 sprintf(outstr + j, "] %d%% used", percentage); 1059 mr_strcat(outstr, "."); 1060 } 1061 mr_strcat(outstr, "] %d%% used", percentage); 1062 1062 return (outstr); 1063 1063 } 1064 1064 1065 1065 1066 /**
Note:
See TracChangeset
for help on using the changeset viewer.