From owner-freebsd-questions Sun Jun 30 16:54:13 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id QAA27647 for questions-outgoing; Sun, 30 Jun 1996 16:54:13 -0700 (PDT) Received: from whistle.com (s205m131.whistle.com [207.76.205.131]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id QAA27642 for ; Sun, 30 Jun 1996 16:54:11 -0700 (PDT) Received: (from smap@localhost) by whistle.com (8.7.5/8.6.12) id QAA23248; Sun, 30 Jun 1996 16:53:39 -0700 (PDT) Received: from bubba.whistle.com(207.76.205.7) by whistle.com via smap (V1.3) id sma023244; Sun Jun 30 16:53:22 1996 Received: (from archie@localhost) by bubba.whistle.com (8.6.12/8.6.12) id QAA27875; Sun, 30 Jun 1996 16:53:22 -0700 From: Archie Cobbs Message-Id: <199606302353.QAA27875@bubba.whistle.com> Subject: strtouq() To: freebsd-questions@freebsd.org Date: Sun, 30 Jun 1996 16:53:21 -0700 (PDT) X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Is this function strtouq() completely broken or am I doing something dumb ? Here's a test program... #include #include #include #include #include int main(int ac, char *av[]) { u_quad_t num; if (ac != 2) errx(1, "bad usage"); num = strtouq(av[1], NULL, 0); printf("Result: %s -> %qu\n", av[1], num); return(0); } It produces this output... $ strtouq 1234 Result: 1234 -> 1234 $ strtouq 4294967294 Result: 4294967294 -> 4294967294 $ strtouq 4294967296 Result: 4294967296 -> 18446744073709551615 $ strtouq 18446744073709551615 Result: 18446744073709551615 -> 18446744073709551615 $ strtouq 18446744073709551614 Result: 18446744073709551614 -> 18446744073709551615 Seems like it can't handle any value higher than 2^32 ? This happens on both 2.1 and -current. -Archie ___________________________________________________________________________ Archie L. Cobbs, archie@whistle.com * Whistle Communications Corporation