Mercurial > hg > octave-lojdl > gnulib-hg
annotate lib/xstrdup.c @ 2942:c5e4ce044bd7
fix typo: s/fseek0/fseeko/
author | Jim Meyering <jim@meyering.net> |
---|---|
date | Sun, 29 Oct 2000 17:19:51 +0000 |
parents | 807294ed0f4f |
children | 60376ca48442 |
rev | line source |
---|---|
5 | 1 /* xstrdup.c -- copy a string with out of memory checking |
2807
807294ed0f4f
back out Copyright date changes for files with no changes year
Jim Meyering <jim@meyering.net>
parents:
2718
diff
changeset
|
2 Copyright (C) 1990, 1996, 1998 Free Software Foundation, Inc. |
5 | 3 |
4 This program is free software; you can redistribute it and/or modify | |
5 it under the terms of the GNU General Public License as published by | |
6 the Free Software Foundation; either version 2, or (at your option) | |
7 any later version. | |
8 | |
9 This program is distributed in the hope that it will be useful, | |
10 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 GNU General Public License for more details. | |
13 | |
14 You should have received a copy of the GNU General Public License | |
649
89f4c1937ac7
update FSF address in copyright and remove any trailing blanks
Jim Meyering <jim@meyering.net>
parents:
5
diff
changeset
|
15 along with this program; if not, write to the Free Software Foundation, |
89f4c1937ac7
update FSF address in copyright and remove any trailing blanks
Jim Meyering <jim@meyering.net>
parents:
5
diff
changeset
|
16 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
5 | 17 |
738 | 18 #if HAVE_CONFIG_H |
19 # include <config.h> | |
649
89f4c1937ac7
update FSF address in copyright and remove any trailing blanks
Jim Meyering <jim@meyering.net>
parents:
5
diff
changeset
|
20 #endif |
89f4c1937ac7
update FSF address in copyright and remove any trailing blanks
Jim Meyering <jim@meyering.net>
parents:
5
diff
changeset
|
21 |
1252 | 22 #ifndef PARAMS |
23 # if defined PROTOTYPES || (defined __STDC__ && __STDC__) | |
24 # define PARAMS(Args) Args | |
25 # else | |
26 # define PARAMS(Args) () | |
27 # endif | |
28 #endif | |
29 | |
30 #if STDC_HEADERS || HAVE_STRING_H | |
738 | 31 # include <string.h> |
5 | 32 #else |
738 | 33 # include <strings.h> |
5 | 34 #endif |
738 | 35 |
1252 | 36 #include <sys/types.h> |
37 | |
38 char *xmalloc PARAMS ((size_t n)); | |
738 | 39 |
5 | 40 /* Return a newly allocated copy of STRING. */ |
41 | |
42 char * | |
1252 | 43 xstrdup (const char *string) |
5 | 44 { |
45 return strcpy (xmalloc (strlen (string) + 1), string); | |
46 } |