| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: subr_prf.c,v 1.21 2011/07/17 20:54:52 joerg Exp $ */ | | 1 | /* $NetBSD: subr_prf.c,v 1.22 2013/12/24 21:41:49 jakllsch Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1993 | | 4 | * Copyright (c) 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 |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -203,26 +203,30 @@ reswitch: | | | @@ -203,26 +203,30 @@ reswitch: |
203 | ++fmt; | | 203 | ++fmt; |
204 | } | | 204 | } |
205 | #endif | | 205 | #endif |
206 | goto reswitch; | | 206 | goto reswitch; |
207 | case 'l': | | 207 | case 'l': |
208 | #ifdef LIBSA_PRINTF_LONGLONG_SUPPORT | | 208 | #ifdef LIBSA_PRINTF_LONGLONG_SUPPORT |
209 | if (*fmt == 'l') { | | 209 | if (*fmt == 'l') { |
210 | ++fmt; | | 210 | ++fmt; |
211 | lflag |= LLONG; | | 211 | lflag |= LLONG; |
212 | } else | | 212 | } else |
213 | #endif | | 213 | #endif |
214 | lflag |= LONG; | | 214 | lflag |= LONG; |
215 | goto reswitch; | | 215 | goto reswitch; |
| | | 216 | case 'j': |
| | | 217 | if (sizeof(intmax_t) == sizeof(long)) |
| | | 218 | lflag |= LONG; |
| | | 219 | goto reswitch; |
216 | case 't': | | 220 | case 't': |
217 | if (sizeof(PTRDIFF_T) == sizeof(long)) | | 221 | if (sizeof(PTRDIFF_T) == sizeof(long)) |
218 | lflag |= LONG; | | 222 | lflag |= LONG; |
219 | goto reswitch; | | 223 | goto reswitch; |
220 | case 'z': | | 224 | case 'z': |
221 | if (sizeof(ssize_t) == sizeof(long)) | | 225 | if (sizeof(ssize_t) == sizeof(long)) |
222 | lflag |= LONG; | | 226 | lflag |= LONG; |
223 | goto reswitch; | | 227 | goto reswitch; |
224 | case 'c': | | 228 | case 'c': |
225 | ch = va_arg(ap, int); | | 229 | ch = va_arg(ap, int); |
226 | #ifdef LIBSA_PRINTF_WIDTH_SUPPORT | | 230 | #ifdef LIBSA_PRINTF_WIDTH_SUPPORT |
227 | --width; | | 231 | --width; |
228 | #endif | | 232 | #endif |