~ubuntu-branches/ubuntu/natty/curl/natty-proposed

« back to all changes in this revision

Viewing changes to src/writeenv.c

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Schuldei
  • Date: 2009-05-24 21:12:19 UTC
  • mfrom: (1.1.12 upstream)
  • mto: (3.3.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 39.
  • Revision ID: james.westby@ubuntu.com-20090524211219-7jgcwuhl04ixuqsm
Tags: upstream-7.19.5
ImportĀ upstreamĀ versionĀ 7.19.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/***************************************************************************
2
 
 *                                  _   _ ____  _     
3
 
 *  Project                     ___| | | |  _ \| |    
4
 
 *                             / __| | | | |_) | |    
5
 
 *                            | (__| |_| |  _ <| |___ 
 
2
 *                                  _   _ ____  _
 
3
 *  Project                     ___| | | |  _ \| |
 
4
 *                             / __| | | | |_) | |
 
5
 *                            | (__| |_| |  _ <| |___
6
6
 *                             \___|\___/|_| \_\_____|
7
7
 *
8
 
 * Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
 
8
 * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
9
9
 *
10
10
 * This software is licensed as described in the file COPYING, which
11
11
 * you should have received as part of this distribution. The terms
12
12
 * are also available at http://curl.haxx.se/docs/copyright.html.
13
 
 * 
 
13
 *
14
14
 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15
15
 * copies of the Software, and permit persons to whom the Software is
16
16
 * furnished to do so, under the terms of the COPYING file.
18
18
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19
19
 * KIND, either express or implied.
20
20
 *
21
 
 * $Id: writeenv.c,v 1.9 2004/12/15 01:38:25 danf Exp $
 
21
 * $Id: writeenv.c,v 1.11 2008-11-03 15:51:40 giva Exp $
22
22
 ***************************************************************************/
23
23
 
24
24
#include "setup.h"
32
32
#include <kernel.h>
33
33
#endif
34
34
 
 
35
#define _MPRINTF_REPLACE /* use our functions only */
 
36
#include <curl/mprintf.h>
 
37
 
35
38
static const struct
36
39
{
37
40
  const char * name;
79
82
  char *string, numtext[10];
80
83
  long longinfo;
81
84
  double doubleinfo;
82
 
  
 
85
 
83
86
  for (i=0; variables[i].name; i++) {
84
87
    switch (variables[i].type) {
85
88
    case writeenv_STRING:
91
94
 
92
95
    case writeenv_LONG:
93
96
      if (curl_easy_getinfo(curl, variables[i].id, &longinfo) == CURLE_OK) {
94
 
        sprintf(numtext, "%5ld", longinfo);
 
97
        curl_msprintf(numtext, "%5ld", longinfo);
95
98
        internalSetEnv(variables[i].name, numtext);
96
99
      }
97
100
      else
99
102
      break;
100
103
    case writeenv_DOUBLE:
101
104
      if (curl_easy_getinfo(curl, variables[i].id, &doubleinfo) == CURLE_OK) {
102
 
        sprintf(numtext, "%6.2f", doubleinfo);
 
105
        curl_msprintf(numtext, "%6.2f", doubleinfo);
103
106
        internalSetEnv(variables[i].name, numtext);
104
107
      }
105
108
      else