~ubuntu-branches/ubuntu/wily/trafficserver/wily

« back to all changes in this revision

Viewing changes to mgmt/cli/createArgument.cc

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2012-12-17 22:28:16 UTC
  • mfrom: (5.1.8 raring-proposed)
  • Revision ID: package-import@ubuntu.com-20121217222816-7xwjsx5k76zkb63d
Tags: 3.2.0-1ubuntu1
* Revert FreeBSD strerror_r() fixes that give errors with glibc 2.16.
* Apply patch from Konstantinos Margaritis to define barriers on ARM.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/** @file
2
2
 
3
 
  A brief file description
 
3
  This file provides basic create Argument defintion, for any new arguments.
4
4
 
5
5
  @section license License
6
6
 
21
21
  limitations under the License.
22
22
 */
23
23
 
24
 
/*
25
 
 *   createArgument.cc --
26
 
 *
27
 
 *
28
 
 *    This file provides basic create Argument defintion,
29
 
 *    for any new arguments.
30
 
 *
31
 
 *
32
 
 *
33
 
 *
34
 
 *    Dated  : 12/11/2000.
35
 
 */
36
24
 
37
25
#include <stdlib.h>
38
26
#include <tcl.h>
69
57
 
70
58
  size_t key_len = sizeof(char) * (strlen(argument) + 1);
71
59
  aCliArgvTable->key = (char *) ckalloc(key_len);
72
 
  ink_strncpy(aCliArgvTable->key, argument, key_len);
 
60
  ink_strlcpy(aCliArgvTable->key, argument, key_len);
73
61
 
74
62
  aCliArgvTable->position = position;
75
63
 
96
84
  if (defValue != NULL) {
97
85
    size_t def_len = sizeof(char) * (strlen(defValue) + 1);
98
86
    aCliArgvTable->def = (char *) ckalloc(def_len);
99
 
    ink_strncpy(aCliArgvTable->def, defValue, def_len);
 
87
    ink_strlcpy(aCliArgvTable->def, defValue, def_len);
100
88
  }
101
89
 
102
90
 
103
91
  if (helpString != NULL) {
104
92
    size_t help_len = sizeof(char) * (strlen(helpString) + 1);
105
93
    aCliArgvTable->help = (char *) ckalloc(help_len);
106
 
    ink_strncpy(aCliArgvTable->help, helpString, help_len);
 
94
    ink_strlcpy(aCliArgvTable->help, helpString, help_len);
107
95
  }
108
96
 
109
97
  reqd_args = findRequired(cliGetOrgArgvInfo());
153
141
  for (infoPtr = argtable; (infoPtr->key != NULL); infoPtr++) {
154
142
    if (infoPtr->option == CLI_ARGV_REQUIRED) {
155
143
 
156
 
      args[i] = xstrdup(infoPtr->key);
 
144
      args[i] = ats_strdup(infoPtr->key);
157
145
      i++;
158
146
    }
159
147
  }
260
248
  char *endPtr;
261
249
 
262
250
  buf = (char *) ckalloc(sizeof(char) * 256);
263
 
  range_str = xstrdup(range);
 
251
  range_str = ats_strdup(range);
264
252
  len = strlen(range_str);
265
253
  range_str[len] = 0;
266
254
  str = range_str;
334
322
  char *endPtr;
335
323
 
336
324
  buf = (char *) ckalloc(sizeof(char) * 256);
337
 
  range_str = xstrdup(range);
 
325
  range_str = ats_strdup(range);
338
326
  len = strlen(range_str);
339
327
  range_str[len] = 0;
340
328
  str = range_str;