~ubuntu-branches/ubuntu/trusty/argtable2/trusty

« back to all changes in this revision

Viewing changes to src/arg_str.c

  • Committer: Bazaar Package Importer
  • Author(s): Shachar Shemesh
  • Date: 2008-05-07 19:54:52 UTC
  • mfrom: (1.1.3 upstream) (3.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080507195452-30nwhoptl33nxbfi
Tags: 9-1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*********************************************************************
2
2
This file is part of the argtable2 library.
3
 
Copyright (C) 1998-2001,2003-2007 Stewart Heitmann
 
3
Copyright (C) 1998-2001,2003-2008 Stewart Heitmann
4
4
sheitmann@users.sourceforge.net
5
5
 
6
6
The argtable2 library is free software; you can redistribute it and/or
132
132
    result = (struct arg_str*)malloc(nbytes);
133
133
    if (result)
134
134
        {
 
135
        int i;
 
136
 
135
137
        /* init the arg_hdr struct */
136
138
        result->hdr.flag      = ARG_HASVALUE;
137
139
        result->hdr.shortopts = shortopts;
149
151
        /* store the sval[maxcount] array immediately after the arg_str struct */
150
152
        result->sval  = (const char**)(result+1);
151
153
        result->count = 0;
 
154
 
 
155
        /* foolproof the string pointers by initialising them to reference empty strings */
 
156
        for (i=0; i<maxcount; i++)
 
157
            { result->sval[i] = ""; }
152
158
        }
153
159
    /*printf("arg_strn() returns %p\n",result);*/
154
160
    return result;