diff options
Diffstat (limited to 'gl/open-safer.c')
-rw-r--r-- | gl/open-safer.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gl/open-safer.c b/gl/open-safer.c index ce493d5..15bf6a6 100644 --- a/gl/open-safer.c +++ b/gl/open-safer.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* Invoke open, but avoid some glitches. | 1 | /* Invoke open, but avoid some glitches. |
2 | 2 | ||
3 | Copyright (C) 2005, 2006 Free Software Foundation, Inc. | 3 | Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc. |
4 | 4 | ||
5 | This program is free software: you can redistribute it and/or modify | 5 | This program is free software: you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
@@ -38,9 +38,10 @@ open_safer (char const *file, int flags, ...) | |||
38 | /* Assume mode_t promotes to int if and only if it is smaller. | 38 | /* Assume mode_t promotes to int if and only if it is smaller. |
39 | This assumption isn't guaranteed by the C standard, but we | 39 | This assumption isn't guaranteed by the C standard, but we |
40 | don't know of any real-world counterexamples. */ | 40 | don't know of any real-world counterexamples. */ |
41 | mode = (sizeof (mode_t) < sizeof (int) | 41 | if (sizeof (mode_t) < sizeof (int)) |
42 | ? va_arg (ap, int) | 42 | mode = va_arg (ap, int); |
43 | : va_arg (ap, mode_t)); | 43 | else |
44 | mode = va_arg (ap, mode_t); | ||
44 | 45 | ||
45 | va_end (ap); | 46 | va_end (ap); |
46 | } | 47 | } |