1/* missing-string.c - missing string utilities 2 * Copyright (C) 1994, 1998, 1999, 2000, 2001, 3 * 2003 Free Software Foundation, Inc. 4 * 5 * This file is part of Libgcrypt. 6 * 7 * Libgcrypt is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU Lesser General Public License as 9 * published by the Free Software Foundation; either version 2.1 of 10 * the License, or (at your option) any later version. 11 * 12 * Libgcrypt is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU Lesser General Public License for more details. 16 * 17 * You should have received a copy of the GNU Lesser General Public 18 * License along with this program; if not, write to the Free Software 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 20 */ 21 22#include <config.h> 23#include <stdio.h> 24#include <stdlib.h> 25#include <string.h> 26#include <ctype.h> 27 28#include "g10lib.h" 29 30 31#ifndef HAVE_STPCPY 32char * 33stpcpy(char *a,const char *b) 34{ 35 while( *b ) 36 *a++ = *b++; 37 *a = 0; 38 39 return (char*)a; 40} 41#endif 42 43 44#ifndef HAVE_STRCASECMP 45int 46strcasecmp( const char *a, const char *b ) 47{ 48 for( ; *a && *b; a++, b++ ) { 49 if( *a != *b && toupper(*a) != toupper(*b) ) 50 break; 51 } 52 return *(const byte*)a - *(const byte*)b; 53} 54#endif 55