File: cwe.l

package info (click to toggle)
flawfinder 1.31-1
  • links: PTS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch
  • size: 512 kB
  • ctags: 176
  • sloc: python: 1,405; makefile: 147; ansic: 136; lex: 29
file content (29 lines) | stat: -rw-r--r-- 357 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
%{

/* cwe by David A. Wheeler (http://www.dwheeler.com).
   This prints anything of the form CWE-#
*/

#include <stdio.h>
#include <ctype.h>
#include <string.h>

void out(char *text) {
	fputs(text,stdout);
}

void outchar(char c) {
	fputc(c, stdout);
}


%}


%%
CWE-[1-9][0-9]* { out(yytext); outchar('\n'); }
.               { }
\n              { }

%%