atoi.c revision 88681
1236099Sdes/* 2236099Sdes * Copyright (c) 1988, 1993 3236099Sdes * The Regents of the University of California. All rights reserved. 4236099Sdes * 5236099Sdes * Redistribution and use in source and binary forms, with or without 6236099Sdes * modification, are permitted provided that the following conditions 7236099Sdes * are met: 8236099Sdes * 1. Redistributions of source code must retain the above copyright 9236099Sdes * notice, this list of conditions and the following disclaimer. 10236099Sdes * 2. Redistributions in binary form must reproduce the above copyright 11236099Sdes * notice, this list of conditions and the following disclaimer in the 12236099Sdes * documentation and/or other materials provided with the distribution. 13236099Sdes * 3. All advertising materials mentioning features or use of this software 14236099Sdes * must display the following acknowledgement: 15236099Sdes * This product includes software developed by the University of 16236099Sdes * California, Berkeley and its contributors. 17236099Sdes * 4. Neither the name of the University nor the names of its contributors 18236099Sdes * may be used to endorse or promote products derived from this software 19236099Sdes * without specific prior written permission. 20236099Sdes * 21236099Sdes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22236099Sdes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23236099Sdes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24236099Sdes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25236099Sdes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26236099Sdes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27236099Sdes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28236099Sdes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29236099Sdes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30236099Sdes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31236099Sdes * SUCH DAMAGE. 32236099Sdes * 33236099Sdes * $FreeBSD: head/lib/libc/stdlib/atoi.c 88681 2001-12-30 03:34:46Z ache $ 34236099Sdes */ 35236099Sdes 36236099Sdes#if defined(LIBC_SCCS) && !defined(lint) 37236099Sdesstatic char sccsid[] = "@(#)atoi.c 8.1 (Berkeley) 6/4/93"; 38236099Sdes#endif /* LIBC_SCCS and not lint */ 39236099Sdes 40236099Sdes#include <stdlib.h> 41236099Sdes 42236099Sdesint 43236099Sdesatoi(str) 44236099Sdes const char *str; 45236099Sdes{ 46236099Sdes return (int)strtol(str, (char **)NULL, 10); 47236099Sdes} 48236099Sdes