| 1 | #!/bin/sh |
| 2 | ###################################################################### |
| 3 | # Copyright (C) 2000,2007 Alan DeKok <[email protected]> |
| 4 | # |
| 5 | # This program is free software; you can redistribute it and/or modify |
| 6 | # it under the terms of the GNU General Public License as published by |
| 7 | # the Free Software Foundation; either version 2 of the License, or (at |
| 8 | # your option) any later version. |
| 9 | # |
| 10 | # This program is distributed in the hope that it will be useful, but |
| 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | # General Public License for more details. |
| 14 | # |
| 15 | # You should have received a copy of the GNU General Public License |
| 16 | # along with this program; if not, write to the Free Software |
| 17 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
| 18 | # USA |
| 19 | ###################################################################### |
| 20 | # |
| 21 | # This is a quick & dirty shell script which roots through the |
| 22 | # given files looking for function prototypes using variable |
| 23 | # arguments, and a 'char' string, which we assume to be a format. |
| 24 | # |
| 25 | # There's no guarantee that this will catch ALL of the problem |
| 26 | # functions, (e.g. multi-line prototypes will be missed), but it |
| 27 | # will catch the most common ones. |
| 28 | # |
| 29 | # You'll have to turn the output into pscan rules by hand. |
| 30 | # |
| 31 | ###################################################################### |
| 32 | grep -n '\.\.\.' $@ | grep ';' | grep 'char' |