#!/bin/sh
# $Id: checks.sh,v 1.1 2005/07/23 22:59:46 devel Exp $
# Author: Jim Brooks  http://www.jimbrooks.org
# Do some checks before compiling.
#-------------------------------------------------------------------------------

SRC_DIR=$1
[ -d $SRC_DIR ] || exit 1

# A habitual mistake that causes a buffer overrun is passing sizeof()
# to InitArray() which expects an element count, not a byte count.
if ( grep -q "InitArray.*sizeof" $SRC_DIR/*.* ); then
    echo "ERROR: sizeof() cannot be passed to InitArray()"
    echo "ERROR: at dir: ${SRC_DIR}"
    exit 1
fi

exit 0
