~ubuntu-branches/ubuntu/maverick/openssl/maverick

« back to all changes in this revision

Viewing changes to crypto/stack/stack.c

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Martin
  • Date: 2004-12-16 18:41:29 UTC
  • mto: (11.1.1 lenny)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20041216184129-z7xjkul57mh1jiha
Tags: upstream-0.9.7e
ImportĀ upstreamĀ versionĀ 0.9.7e

Show diffs side-by-side

added added

removed removed

Lines of Context:
191
191
        char *ret;
192
192
        int i,j;
193
193
 
194
 
        if ((st == NULL) || (st->num == 0) || (loc < 0)
195
 
                                         || (loc >= st->num)) return(NULL);
 
194
        if(!st || (loc < 0) || (loc >= st->num)) return NULL;
196
195
 
197
196
        ret=st->data[loc];
198
197
        if (loc != st->num-1)
306
305
 
307
306
char *sk_value(const STACK *st, int i)
308
307
{
309
 
        if(st == NULL) return NULL;
 
308
        if(!st || (i < 0) || (i >= st->num)) return NULL;
310
309
        return st->data[i];
311
310
}
312
311
 
313
312
char *sk_set(STACK *st, int i, char *value)
314
313
{
315
 
        if(st == NULL) return NULL;
 
314
        if(!st || (i < 0) || (i >= st->num)) return NULL;
316
315
        return (st->data[i] = value);
317
316
}
318
317
 
332
331
                st->sorted=1;
333
332
                }
334
333
        }
 
334
 
 
335
int sk_is_sorted(const STACK *st)
 
336
        {
 
337
        if (!st)
 
338
                return 1;
 
339
        return st->sorted;
 
340
        }