From 3f4eabd19215fe1271594ac3ec81d543d2714f20 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 12 Oct 2011 23:58:12 -0700 Subject: * editfns.c (Fuser_login_name, Fuser_full_name): Signal an error if a uid argument is out of range, rather than relying on undefined behavior. --- src/editfns.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/editfns.c') diff --git a/src/editfns.c b/src/editfns.c index ac9c20ced6..8489a47649 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -1247,7 +1247,7 @@ of the user with that uid, or nil if there is no such user. */) if (NILP (uid)) return Vuser_login_name; - id = XFLOATINT (uid); + CONS_TO_INTEGER (uid, uid_t, id); BLOCK_INPUT; pw = getpwuid (id); UNBLOCK_INPUT; @@ -1306,7 +1306,8 @@ name, or nil if there is no such user. */) return Vuser_full_name; else if (NUMBERP (uid)) { - uid_t u = XFLOATINT (uid); + uid_t u; + CONS_TO_INTEGER (uid, uid_t, u); BLOCK_INPUT; pw = getpwuid (u); UNBLOCK_INPUT; -- cgit v1.2.3