Skip to content

Commit

Permalink
dpcmd.c
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Dec 21, 2021
1 parent 37c9671 commit bf9a2f4
Showing 1 changed file with 34 additions and 32 deletions.
66 changes: 34 additions & 32 deletions dpcmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1588,45 +1588,47 @@ void do_DisplayOrSave(void)
printf("\n\n");
} else {
UploadAddrRange.length = UploadAddrRange.end - UploadAddrRange.start;
char SourceStr[64];

char SourceStr[64];


sprintf(SourceStr, "%s", g_parameter_read);



int len = strlen(SourceStr);
int i = len;

while(SourceStr[i]!='.' && i>0)
i--;

char ExtStr[64];
if(SourceStr[i]=='.')
if(dev_cnt>1)
{
sprintf(ExtStr, "%s", &SourceStr[i]);
char *loc = strstr(SourceStr,ExtStr);

for(int i=loc-SourceStr;i<strlen(SourceStr);i++)
SourceStr[i]='\0';
// printf("\n 1ExtStr= %s",ExtStr);
char str[64];

sprintf(str, "_%d", icnt + 1);
strcat(SourceStr, str);
strcat(SourceStr, ExtStr);
int len = strlen(SourceStr);
int i = len;

while(SourceStr[i]!='.' && i>0)
i--;

char ExtStr[64];
if(SourceStr[i]=='.')
{
sprintf(ExtStr, "%s", &SourceStr[i]);
char *loc = strstr(SourceStr,ExtStr);

for(int i=loc-SourceStr;i<strlen(SourceStr);i++)
SourceStr[i]='\0';
// printf("\n 1ExtStr= %s",ExtStr);
char str[64];

sprintf(str, "_%d", icnt + 1);
strcat(SourceStr, str);
strcat(SourceStr, ExtStr);
}
else
{
sprintf(ExtStr, "%s", &SourceStr[0]);
//printf("\n 2ExtStr= %s",ExtStr);

char str[64];
sprintf(str, "_%d", icnt + 1);
strcat(SourceStr, str);
}
}
else
{
sprintf(ExtStr, "%s", &SourceStr[0]);
//printf("\n 2ExtStr= %s",ExtStr);

char str[64];
sprintf(str, "_%d", icnt + 1);
strcat(SourceStr, str);
}



if (WriteFile((const char*)SourceStr, pBufferForLastReadData[icnt], UploadAddrRange.length) == 1)
printf("\nSuccessfully saved into file:%s \n", SourceStr);
else
Expand Down

0 comments on commit bf9a2f4

Please sign in to comment.