nixpkgs/pkgs/development/libraries/czmq/czmq3-gcc7.patch

27 lines
1.1 KiB
Diff
Raw Normal View History

2017-11-17 08:04:00 +01:00
diff --git a/src/zgossip_engine.inc b/src/zgossip_engine.inc
index 37dbb4eb..727aaa9b 100644
--- a/src/zgossip_engine.inc
+++ b/src/zgossip_engine.inc
@@ -258,7 +258,7 @@ engine_set_log_prefix (client_t *client, const char *string)
{
if (client) {
s_client_t *self = (s_client_t *) client;
- snprintf (self->log_prefix, sizeof (self->log_prefix) - 1,
+ snprintf (self->log_prefix, sizeof (self->log_prefix),
"%6d:%-33s", self->unique_id, string);
}
}
diff --git a/src/zsys.c b/src/zsys.c
index 4d0bb8a1..f07db9c8 100644
--- a/src/zsys.c
+++ b/src/zsys.c
@@ -1071,7 +1071,7 @@ zsys_run_as (const char *lockfile, const char *group, const char *user)
}
}
// We record the current process id in the lock file
- char pid_buffer [10];
+ char pid_buffer [32];
snprintf (pid_buffer, sizeof (pid_buffer), "%6d\n", getpid ());
if (write (handle, pid_buffer, strlen (pid_buffer)) != strlen (pid_buffer)) {
zsys_error ("cannot write to lockfile: %s", strerror (errno));