diff options
Diffstat (limited to 'lib/malloc/dynarray_at_failure.c')
| -rw-r--r-- | lib/malloc/dynarray_at_failure.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/malloc/dynarray_at_failure.c b/lib/malloc/dynarray_at_failure.c index a4424593748..8dd68507870 100644 --- a/lib/malloc/dynarray_at_failure.c +++ b/lib/malloc/dynarray_at_failure.c | |||
| @@ -3,22 +3,26 @@ | |||
| 3 | This file is part of the GNU C Library. | 3 | This file is part of the GNU C Library. |
| 4 | 4 | ||
| 5 | The GNU C Library is free software; you can redistribute it and/or | 5 | The GNU C Library is free software; you can redistribute it and/or |
| 6 | modify it under the terms of the GNU General Public | 6 | modify it under the terms of the GNU Lesser General Public |
| 7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
| 8 | version 3 of the License, or (at your option) any later version. | 8 | version 2.1 of the License, or (at your option) any later version. |
| 9 | 9 | ||
| 10 | The GNU C Library is distributed in the hope that it will be useful, | 10 | The GNU C Library is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | General Public License for more details. | 13 | Lesser General Public License for more details. |
| 14 | 14 | ||
| 15 | You should have received a copy of the GNU General Public | 15 | You should have received a copy of the GNU Lesser General Public |
| 16 | License along with the GNU C Library; if not, see | 16 | License along with the GNU C Library; if not, see |
| 17 | <https://www.gnu.org/licenses/>. */ | 17 | <https://www.gnu.org/licenses/>. */ |
| 18 | 18 | ||
| 19 | #ifndef _LIBC | ||
| 20 | # include <libc-config.h> | ||
| 21 | # include <stdlib.h> | ||
| 22 | #endif | ||
| 23 | |||
| 19 | #include <dynarray.h> | 24 | #include <dynarray.h> |
| 20 | #include <stdio.h> | 25 | #include <stdio.h> |
| 21 | #include <stdlib.h> | ||
| 22 | 26 | ||
| 23 | void | 27 | void |
| 24 | __libc_dynarray_at_failure (size_t size, size_t index) | 28 | __libc_dynarray_at_failure (size_t size, size_t index) |
| @@ -28,6 +32,7 @@ __libc_dynarray_at_failure (size_t size, size_t index) | |||
| 28 | __snprintf (buf, sizeof (buf), "Fatal glibc error: " | 32 | __snprintf (buf, sizeof (buf), "Fatal glibc error: " |
| 29 | "array index %zu not less than array length %zu\n", | 33 | "array index %zu not less than array length %zu\n", |
| 30 | index, size); | 34 | index, size); |
| 35 | __libc_fatal (buf); | ||
| 31 | #else | 36 | #else |
| 32 | abort (); | 37 | abort (); |
| 33 | #endif | 38 | #endif |