5char *
HDD_MakeNewRecName(
const char *fname, word sequence,
char *NewRecName,
int NewRecNameSize)
15 if(NewRecName && NewRecNameSize)
17 memset(NewRecName, 0, NewRecNameSize);
18 memset(
try, 0,
sizeof(
try));
20 Slash = strrchr(fname,
'/');
25 i = (dword)Slash - (dword)fname + 1;
27 if(i >= NewRecNameSize)
33 strncpy(NewRecName, fname, i);
34 strncpy(
try, Slash + 1,
sizeof(
try));
38 strncpy(
try, fname,
sizeof(
try));
43 if(!(p = strrchr(
try,
'.'))) p =
try + len;
44 if((j = MAX_FILE_NAME_SIZE - len - 3) < 0)
50 memmove(p + 3, p, strlen(p) + 1);
54 c1 = sequence / 10 % 10 +
'0';
55 c2 = sequence % 10 +
'0';
61 c1 = rand() % 26 +
'A';
62 c2 = rand() % 26 +
'A';
69 if((strlen(NewRecName) + strlen(
try)) >= (dword)NewRecNameSize)
76 strcat(NewRecName,
try);
char * HDD_MakeNewRecName(const char *fname, word sequence, char *NewRecName, int NewRecNameSize)