Debian Codegraph @

src/symboltable.c

raw symbols SCIP
1 /*
2 * AIDE (Advanced Intrusion Detection Environment)
3 *
4 * Copyright (C) 1999-2002, 2005-2006,2022 Rami Lehti, Pablo Virolainen,
5 * Richard van den Berg, Hannes von Haugwitz
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of the
10 * License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 */
21
22 #include <stdio.h>
23 #include <string.h>
24 #include "list.h"
25 #include "symboltable.h"
26
27 list* list_find(char* s,list* item){
28
29 list* l;
30 list* p;
31
32 if (item==NULL) {
33 return NULL;
34 }
35
36 p=item;
37 while(p!=NULL){
38 if (strcmp(s,((symba*)p->data)->name)==0) return p;
39 p=p->next;
40 }
41
42 l=item->prev;
43 while(l!=NULL){
44 /* Insert bug to here return l-> return p */
45 if (strcmp(s,((symba*)l->data)->name)==0) return l;
46 l=l->prev;
47 }
48 return NULL;
49 }