mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-03 00:10:10 +00:00
(describe_number): Correctly allocate space in DESCRIPTION for the digits in I.
This commit is contained in:
parent
06f82985cb
commit
d3dc731b47
@ -233,6 +233,9 @@ interrupted_reply_port_location (struct machine_thread_all_state *thread_state,
|
||||
#include <hurd/sigpreempt.h>
|
||||
#include "intr-msg.h"
|
||||
|
||||
/* Timeout on interrupt_operation calls. */
|
||||
mach_msg_timeout_t _hurdsig_interrupt_timeout = 1000;
|
||||
|
||||
/* SS->thread is suspended.
|
||||
|
||||
Abort any interruptible RPC operation the thread is doing.
|
||||
@ -299,7 +302,7 @@ _hurdsig_abort_rpcs (struct hurd_sigstate *ss, int signo, int sigthread,
|
||||
|
||||
mach_port_t *reply = interrupted_reply_port_location (state,
|
||||
sigthread);
|
||||
error_t err = __interrupt_operation (intr_port);
|
||||
error_t err = __interrupt_operation (intr_port, _hurdsig_interrupt_timeout);
|
||||
|
||||
if (err)
|
||||
{
|
||||
|
@ -29,15 +29,20 @@ Cambridge, MA 02139, USA. */
|
||||
static void
|
||||
describe_number (string_t description, const char *flavor, int i)
|
||||
{
|
||||
int j;
|
||||
char *p = __stpcpy (description, flavor);
|
||||
p += i / 10 + 1;
|
||||
*p = '\0';
|
||||
|
||||
/* Allocate space for the number at the end of DESCRIPTION. */
|
||||
for (j = i; j >= 10; j /= 10)
|
||||
p++;
|
||||
p[1] = '\0';
|
||||
|
||||
do
|
||||
{
|
||||
*--p = '0' + i % 10;
|
||||
*p-- = '0' + i % 10;
|
||||
i /= 10;
|
||||
} while (i != 0);
|
||||
assert (p[-1] == '#');
|
||||
assert (*p == '#');
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user