Commit 93e391eb authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

Renaming a variable.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5288 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent 9fcde230
Showing with 5 additions and 3 deletions
+5 -3
2015-07-10 Benno Schulenberg <bensberg@justemail.net> 2015-07-10 Benno Schulenberg <bensberg@justemail.net>
* src/nano.c (delete_opennode): Plug a small memory leak. * src/nano.c (delete_opennode): Plug a small memory leak.
* src/files.c (do_lockfile): Rename a variable; it does not contain
the size of the file but the size of the name.
2015-07-06 Benno Schulenberg <bensberg@justemail.net> 2015-07-06 Benno Schulenberg <bensberg@justemail.net>
* src/global.c (add_to_sclist), src/help.c (help_init), src/nano.h, * src/global.c (add_to_sclist), src/help.c (help_init), src/nano.h,
......
...@@ -249,15 +249,15 @@ int do_lockfile(const char *filename) ...@@ -249,15 +249,15 @@ int do_lockfile(const char *filename)
{ {
char *lockdir = dirname((char *) mallocstrcpy(NULL, filename)); char *lockdir = dirname((char *) mallocstrcpy(NULL, filename));
char *lockbase = basename((char *) mallocstrcpy(NULL, filename)); char *lockbase = basename((char *) mallocstrcpy(NULL, filename));
size_t lockfilesize = strlen(filename) + strlen(locking_prefix) size_t locknamesize = strlen(filename) + strlen(locking_prefix)
+ strlen(locking_suffix) + 3; + strlen(locking_suffix) + 3;
char *lockfilename = charalloc(lockfilesize); char *lockfilename = charalloc(locknamesize);
char *lockfiledir = NULL; char *lockfiledir = NULL;
static char lockprog[11], lockuser[17]; static char lockprog[11], lockuser[17];
struct stat fileinfo; struct stat fileinfo;
int lockfd, lockpid; int lockfd, lockpid;
snprintf(lockfilename, lockfilesize, "%s/%s%s%s", lockdir, snprintf(lockfilename, locknamesize, "%s/%s%s%s", lockdir,
locking_prefix, lockbase, locking_suffix); locking_prefix, lockbase, locking_suffix);
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "lock file name is %s\n", lockfilename); fprintf(stderr, "lock file name is %s\n", lockfilename);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment