From 31c286f79d43a002f441b90dc0176014ba0fa8e7 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 29 Aug 2011 12:46:15 -0700 Subject: [PATCH] * process.c (make_process): Use printmax_t, not int, to format process-name gensyms. --- src/ChangeLog | 3 +++ src/process.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index d1d11df1900..b1c29363da0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -85,6 +85,9 @@ index. Don't assume hash table size fits in 'long', or that vectorlike size fits in 'unsigned long'. + * process.c (make_process): Use printmax_t, not int, to format + process-name gensyms. + 2011-08-26 Paul Eggert Integer and memory overflow issues (Bug#9196). diff --git a/src/process.c b/src/process.c index a8088322147..058ad5f871f 100644 --- a/src/process.c +++ b/src/process.c @@ -616,8 +616,8 @@ make_process (Lisp_Object name) { register Lisp_Object val, tem, name1; register struct Lisp_Process *p; - char suffix[10]; - register int i; + char suffix[sizeof "<>" + INT_STRLEN_BOUND (printmax_t)]; + printmax_t i; p = allocate_process (); @@ -651,7 +651,7 @@ make_process (Lisp_Object name) { tem = Fget_process (name1); if (NILP (tem)) break; - sprintf (suffix, "<%d>", i); + sprintf (suffix, "<%"pMd">", i); name1 = concat2 (name, build_string (suffix)); } name = name1; -- 2.39.2