~ubuntu-branches/ubuntu/natty/gnupg2/natty-security

« back to all changes in this revision

Viewing changes to gl/printf-args.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Urlichs
  • Date: 2005-12-08 22:13:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051208221321-4rvs2vu835iam5wv
Tags: 1.9.19-2
* Convert debian/changelog to UTF-8.
* Put gnupg-agent and gpgsm lintian overrides in the respectively
  right package.  Closes: #335066
* Added debhelper tokens to maintainer scripts.
* xsession fixes:
  o Added host name to gpg-agent PID file name.  Closes: #312717
  o Fixed xsession script to be able to run under zsh.  Closes: #308516
  o Don't run gpg-agent if one is already running.  Closes: #336480
* debian/control:
  o Fixed package description of gpgsm package.  Closes: #299842
  o Added mention of gpg-agent to description of gnupg-agent package.
    Closes: #304355
* Thanks to Peter Eisentraut <petere@debian.org> for all of the above.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Decomposed printf argument list.
 
2
   Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
 
3
 
 
4
   This program is free software; you can redistribute it and/or modify
 
5
   it under the terms of the GNU General Public License as published by
 
6
   the Free Software Foundation; either version 2, or (at your option)
 
7
   any later version.
 
8
 
 
9
   This program is distributed in the hope that it will be useful,
 
10
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
   GNU General Public License for more details.
 
13
 
 
14
   You should have received a copy of the GNU General Public License along
 
15
   with this program; if not, write to the Free Software Foundation,
 
16
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
17
 
 
18
#ifdef HAVE_CONFIG_H
 
19
# include <config.h>
 
20
#endif
 
21
 
 
22
/* Specification.  */
 
23
#include "printf-args.h"
 
24
 
 
25
#ifdef STATIC
 
26
STATIC
 
27
#endif
 
28
int
 
29
printf_fetchargs (va_list args, arguments *a)
 
30
{
 
31
  size_t i;
 
32
  argument *ap;
 
33
 
 
34
  for (i = 0, ap = &a->arg[0]; i < a->count; i++, ap++)
 
35
    switch (ap->type)
 
36
      {
 
37
      case TYPE_SCHAR:
 
38
        ap->a.a_schar = va_arg (args, /*signed char*/ int);
 
39
        break;
 
40
      case TYPE_UCHAR:
 
41
        ap->a.a_uchar = va_arg (args, /*unsigned char*/ int);
 
42
        break;
 
43
      case TYPE_SHORT:
 
44
        ap->a.a_short = va_arg (args, /*short*/ int);
 
45
        break;
 
46
      case TYPE_USHORT:
 
47
        ap->a.a_ushort = va_arg (args, /*unsigned short*/ int);
 
48
        break;
 
49
      case TYPE_INT:
 
50
        ap->a.a_int = va_arg (args, int);
 
51
        break;
 
52
      case TYPE_UINT:
 
53
        ap->a.a_uint = va_arg (args, unsigned int);
 
54
        break;
 
55
      case TYPE_LONGINT:
 
56
        ap->a.a_longint = va_arg (args, long int);
 
57
        break;
 
58
      case TYPE_ULONGINT:
 
59
        ap->a.a_ulongint = va_arg (args, unsigned long int);
 
60
        break;
 
61
#ifdef HAVE_LONG_LONG
 
62
      case TYPE_LONGLONGINT:
 
63
        ap->a.a_longlongint = va_arg (args, long long int);
 
64
        break;
 
65
      case TYPE_ULONGLONGINT:
 
66
        ap->a.a_ulonglongint = va_arg (args, unsigned long long int);
 
67
        break;
 
68
#endif
 
69
      case TYPE_DOUBLE:
 
70
        ap->a.a_double = va_arg (args, double);
 
71
        break;
 
72
#ifdef HAVE_LONG_DOUBLE
 
73
      case TYPE_LONGDOUBLE:
 
74
        ap->a.a_longdouble = va_arg (args, long double);
 
75
        break;
 
76
#endif
 
77
      case TYPE_CHAR:
 
78
        ap->a.a_char = va_arg (args, int);
 
79
        break;
 
80
#ifdef HAVE_WINT_T
 
81
      case TYPE_WIDE_CHAR:
 
82
        ap->a.a_wide_char = va_arg (args, wint_t);
 
83
        break;
 
84
#endif
 
85
      case TYPE_STRING:
 
86
        ap->a.a_string = va_arg (args, const char *);
 
87
        break;
 
88
#ifdef HAVE_WCHAR_T
 
89
      case TYPE_WIDE_STRING:
 
90
        ap->a.a_wide_string = va_arg (args, const wchar_t *);
 
91
        break;
 
92
#endif
 
93
      case TYPE_POINTER:
 
94
        ap->a.a_pointer = va_arg (args, void *);
 
95
        break;
 
96
      case TYPE_COUNT_SCHAR_POINTER:
 
97
        ap->a.a_count_schar_pointer = va_arg (args, signed char *);
 
98
        break;
 
99
      case TYPE_COUNT_SHORT_POINTER:
 
100
        ap->a.a_count_short_pointer = va_arg (args, short *);
 
101
        break;
 
102
      case TYPE_COUNT_INT_POINTER:
 
103
        ap->a.a_count_int_pointer = va_arg (args, int *);
 
104
        break;
 
105
      case TYPE_COUNT_LONGINT_POINTER:
 
106
        ap->a.a_count_longint_pointer = va_arg (args, long int *);
 
107
        break;
 
108
#ifdef HAVE_LONG_LONG
 
109
      case TYPE_COUNT_LONGLONGINT_POINTER:
 
110
        ap->a.a_count_longlongint_pointer = va_arg (args, long long int *);
 
111
        break;
 
112
#endif
 
113
      default:
 
114
        /* Unknown type.  */
 
115
        return -1;
 
116
      }
 
117
  return 0;
 
118
}