torvalds / uemacs

Random version of microemacs with my private modificatons
1.21k stars 234 forks source link

Wrong declaration in dolock? #31

Closed rvillalob closed 4 years ago

rvillalob commented 4 years ago

In dolock, shouldn't the declaration be: lname[MAXNAME], locker[MAXLOCK + 1]...

Instead of: lname[MAXLOCK], locker[MAXNAME + 1]...

This causes the function to read an arbitrary 128 bytes from the file instead if 512, which I don't understand why.

rfivet commented 4 years ago

Declarations match the use. lname holds the file name of the lock file which is the edited file name + ".lock~". locker is a static variable used to identify who is currently editing the file (user@hostname). Based on latest commit on maximum filename length (80 -> 256) , 512 is way too much.