From: Alan T. DeKok Date: Thu, 21 Feb 2013 14:34:31 +0000 (-0500) Subject: Fix error strings to make more sense X-Git-Tag: release_2_2_1~130 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de378e0507d98f95402ad1aa0d6b6d25ce66db3c;p=thirdparty%2Ffreeradius-server.git Fix error strings to make more sense --- diff --git a/src/lib/dhcp.c b/src/lib/dhcp.c index 98f4546363e..8df7f8568c0 100644 --- a/src/lib/dhcp.c +++ b/src/lib/dhcp.c @@ -701,7 +701,9 @@ int fr_dhcp_decode(RADIUS_PACKET *packet) for (i = 0; i < 14; i++) { vp = pairmake(dhcp_header_names[i], NULL, T_OP_EQ); if (!vp) { - fr_strerror_printf("Parse error %s", fr_strerror()); + char buffer[256]; + strlcpy(buffer, fr_strerror(), sizeof(buffer)); + fr_strerror_printf("Cannot decode packet due to internal error: %s", buffer); pairfree(&head); return -1; } @@ -1232,7 +1234,9 @@ int fr_dhcp_encode(RADIUS_PACKET *packet) for (i = 0; i < 14; i++) { vp = pairmake(dhcp_header_names[i], NULL, T_OP_EQ); if (!vp) { - fr_strerror_printf("Parse error %s", fr_strerror()); + char buffer[256]; + strlcpy(buffer, fr_strerror(), sizeof(buffer)); + fr_strerror_printf("Cannot decode packet due to internal error: %s", buffer); return -1; }