fat pading
Posted: Mon Jul 11, 2005 9:49 am
hi all, for any one who doesn't know for fat names, you must convert names as follows:
so that before the dot has 8 places aftor 3.
my code simply copys letter per letter, if a dot what ever is left is "spaced":
when i run it, it kills the system???
Code: Select all
"file.txt" -> "file txt"
my code simply copys letter per letter, if a dot what ever is left is "spaced":
Code: Select all
unsigned char *fat_pad(unsigned char *str)
{
int pc = 0, sc = 0; // pc = paded count, sc = str count
while(str[sc] != '\0') // while more left in string
{
if(str[sc] == '.') // if dot
{
for(; pc < 8; pc++) // untill 8
paded[pc] = ' '; // space pad
sc++; // jump over dot
}
paded[pc] = str[sc]; // reg letter just transfer
pc++; sc++; // move 1 letter ahead
}
return paded; // return new string
}