Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: third_party/yasm/patched-yasm/libyasm/xstrdup.c

Issue 11364046: Update Yasm to 1.2.0 (Yasm Part 1/3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * strdup() implementation with error checking (using xmalloc). 2 * strdup() implementation with error checking (using xmalloc).
3 * 3 *
4 * Copyright (c) 1988, 1993 4 * Copyright (c) 1988, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 11 matching lines...) Expand all
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE. 29 * SUCH DAMAGE.
30 */ 30 */
31 #include "util.h" 31 #include "util.h"
32 RCSID("$Id: xstrdup.c 1893 2007-07-14 03:11:32Z peter $");
33 32
34 #include "coretype.h" 33 #include "coretype.h"
35 34
36 #if defined(LIBC_SCCS) && !defined(lint) 35 #if defined(LIBC_SCCS) && !defined(lint)
37 static char sccsid[] = "@(#)strdup.c 8.1 (Berkeley) 6/4/93"; 36 static char sccsid[] = "@(#)strdup.c 8.1 (Berkeley) 6/4/93";
38 #endif /* LIBC_SCCS and not lint */ 37 #endif /* LIBC_SCCS and not lint */
39 38
40 39
41 #ifdef WITH_DMALLOC 40 #ifdef WITH_DMALLOC
42 #undef yasm__xstrdup 41 #undef yasm__xstrdup
(...skipping 17 matching lines...) Expand all
60 size_t len = 0; 59 size_t len = 0;
61 char *copy; 60 char *copy;
62 61
63 while (len < max && str[len] != '\0') 62 while (len < max && str[len] != '\0')
64 len++; 63 len++;
65 copy = yasm_xmalloc(len+1); 64 copy = yasm_xmalloc(len+1);
66 memcpy(copy, str, len); 65 memcpy(copy, str, len);
67 copy[len] = '\0'; 66 copy[len] = '\0';
68 return (copy); 67 return (copy);
69 } 68 }
OLDNEW
« no previous file with comments | « third_party/yasm/patched-yasm/libyasm/xmalloc.c ('k') | third_party/yasm/patched-yasm/modules/arch/lc3b/lc3barch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698