fix invalid str
This commit is contained in:
parent
7b5e554d85
commit
62c116200c
3
client.c
3
client.c
@ -75,10 +75,11 @@ void DisplayProgressBar(size_t offset,size_t total,double cur_progress){
|
|||||||
}
|
}
|
||||||
void DisplayProgressBar100Percent(size_t total){
|
void DisplayProgressBar100Percent(size_t total){
|
||||||
size_t i;
|
size_t i;
|
||||||
char buf[PROGRESS_BAR_WIDTH];
|
char buf[PROGRESS_BAR_WIDTH+1];
|
||||||
for (i = 0; i < PROGRESS_BAR_WIDTH; i++){
|
for (i = 0; i < PROGRESS_BAR_WIDTH; i++){
|
||||||
buf[i] = '=';
|
buf[i] = '=';
|
||||||
}
|
}
|
||||||
|
buf[PROGRESS_BAR_WIDTH] = '\0';
|
||||||
printf("\r[%s]: 100%% bytes: %ld/%ld bytes\n",buf,total,total);
|
printf("\r[%s]: 100%% bytes: %ld/%ld bytes\n",buf,total,total);
|
||||||
}
|
}
|
||||||
int recvFile(int sock, const char * filename,size_t file_size){
|
int recvFile(int sock, const char * filename,size_t file_size){
|
||||||
|
@ -76,10 +76,11 @@ void DisplayProgressBar(size_t offset,size_t total,double cur_progress){
|
|||||||
}
|
}
|
||||||
void DisplayProgressBar100Percent(size_t total){
|
void DisplayProgressBar100Percent(size_t total){
|
||||||
size_t i;
|
size_t i;
|
||||||
char buf[PROGRESS_BAR_WIDTH];
|
char buf[PROGRESS_BAR_WIDTH+1];
|
||||||
for (i = 0; i < PROGRESS_BAR_WIDTH; i++){
|
for (i = 0; i < PROGRESS_BAR_WIDTH; i++){
|
||||||
buf[i] = '=';
|
buf[i] = '=';
|
||||||
}
|
}
|
||||||
|
buf[PROGRESS_BAR_WIDTH] = '\0';
|
||||||
printf("\r[%s]: 100%% bytes: %ld/%ld bytes\n",buf,total,total);
|
printf("\r[%s]: 100%% bytes: %ld/%ld bytes\n",buf,total,total);
|
||||||
}
|
}
|
||||||
int recvFile(int sock, const char * filename,size_t file_size){
|
int recvFile(int sock, const char * filename,size_t file_size){
|
||||||
|
Loading…
Reference in New Issue
Block a user