Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions common-src/amflock-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,16 @@ static gboolean
inc_counter(file_lock *lock)
{
char old_val = 'a';
char new_val[2];
char new_val;

if (lock->len) {
old_val = lock->data[0];
}

g_assert(old_val < 'z');

new_val[0] = old_val + 1;
new_val[1] = '\0';
if (file_lock_write(lock, new_val, 1) == -1) {
new_val = old_val + 1;
if (file_lock_write(lock, &new_val, 1) == -1) {
g_fprintf(stderr, "file_lock_write: %s\n",
strerror(errno));
return FALSE;
Expand Down
2 changes: 1 addition & 1 deletion common-src/amflock.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ file_lock_write(

if (lock->data)
g_free(lock->data);
lock->data = g_strdup(data);
lock->data = g_strndup(data, len);
lock->len = len;

return 0;
Expand Down
1 change: 0 additions & 1 deletion server-src/server_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
* $Id: server_util.c,v 1.17 2006/05/25 01:47:20 johnfranks Exp $
*
*/

#include <sys/wait.h>

#include "amanda.h"
Expand Down