strfmon.c (104944) | strfmon.c (104946) |
---|---|
1/*- 2 * Copyright (c) 2001 Alexey Zelkin <phantom@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 */ 27 28#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001 Alexey Zelkin <phantom@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 */ 27 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: head/lib/libc/stdlib/strfmon.c 104944 2002-10-11 23:08:03Z tjr $"); | 29__FBSDID("$FreeBSD: head/lib/libc/stdlib/strfmon.c 104946 2002-10-11 23:31:50Z tjr $"); |
30 31#include <sys/types.h> 32#include <ctype.h> 33#include <errno.h> 34#include <limits.h> 35#include <locale.h> 36#include <stdarg.h> 37#include <stdio.h> --- 71 unchanged lines hidden (view full) --- 109 char cs_precedes, /* values gathered from struct lconv */ 110 sep_by_space, 111 sign_posn, 112 *signstr, 113 *currency_symbol; 114 115 char *tmpptr; /* temporary vars */ 116 int *ntmp; | 30 31#include <sys/types.h> 32#include <ctype.h> 33#include <errno.h> 34#include <limits.h> 35#include <locale.h> 36#include <stdarg.h> 37#include <stdio.h> --- 71 unchanged lines hidden (view full) --- 109 char cs_precedes, /* values gathered from struct lconv */ 110 sep_by_space, 111 sign_posn, 112 *signstr, 113 *currency_symbol; 114 115 char *tmpptr; /* temporary vars */ 116 int *ntmp; |
117 int sverrno; |
|
117 118 va_start(ap, format); 119 120 lc = localeconv(); 121 dst = s; 122 fmt = format; 123 asciivalue = NULL; 124 currency_symbol = NULL; --- 247 unchanged lines hidden (view full) --- 372e2big_error: 373 errno = E2BIG; 374 goto end_error; 375 376format_error: 377 errno = EINVAL; 378 379end_error: | 118 119 va_start(ap, format); 120 121 lc = localeconv(); 122 dst = s; 123 fmt = format; 124 asciivalue = NULL; 125 currency_symbol = NULL; --- 247 unchanged lines hidden (view full) --- 373e2big_error: 374 errno = E2BIG; 375 goto end_error; 376 377format_error: 378 errno = EINVAL; 379 380end_error: |
381 sverrno = errno; |
|
380 if (asciivalue != NULL) 381 free(asciivalue); 382 if (currency_symbol != NULL) 383 free(currency_symbol); | 382 if (asciivalue != NULL) 383 free(asciivalue); 384 if (currency_symbol != NULL) 385 free(currency_symbol); |
386 errno = sverrno; |
|
384 va_end(ap); 385 return (-1); 386} 387 388static void 389__setup_vars(int flags, char *cs_precedes, char *sep_by_space, 390 char *sign_posn, char **signstr) { 391 --- 211 unchanged lines hidden --- | 387 va_end(ap); 388 return (-1); 389} 390 391static void 392__setup_vars(int flags, char *cs_precedes, char *sep_by_space, 393 char *sign_posn, char **signstr) { 394 --- 211 unchanged lines hidden --- |