summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2b2a769)
raw | patch | inline | side by side (parent: 2b2a769)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sat, 28 Nov 2015 17:48:20 +0000 (18:48 +0100) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sat, 28 Nov 2015 17:48:20 +0000 (18:48 +0100) |
buffer is a char *, not an array, so size_of returns the size
of the pointer.
of the pointer.
src/amqp.c | patch | blob | history |
diff --git a/src/amqp.c b/src/amqp.c
index aba4f0122ca7c87ab4313da6cc3fd318872a9d88..4206bdc1e3ee36b99192452b377943e007fb8af8 100644 (file)
--- a/src/amqp.c
+++ b/src/amqp.c
switch (r.reply_type)
{
case AMQP_RESPONSE_NORMAL:
- sstrncpy (buffer, "Success", sizeof (buffer));
+ sstrncpy (buffer, "Success", buffer_size);
break;
case AMQP_RESPONSE_NONE:
- sstrncpy (buffer, "Missing RPC reply type", sizeof (buffer));
+ sstrncpy (buffer, "Missing RPC reply type", buffer_size);
break;
case AMQP_RESPONSE_LIBRARY_EXCEPTION:
return (sstrerror (r.library_error, buffer, buffer_size));
#endif
else
- sstrncpy (buffer, "End of stream", sizeof (buffer));
+ sstrncpy (buffer, "End of stream", buffer_size);
break;
case AMQP_RESPONSE_SERVER_EXCEPTION: