buf_size: fix bytes_per_element() for strings and arrays
commit5604845a144d1448c9304d5be7c1bd26f24bae8b
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 13 Jun 2012 13:17:44 +0000 (13 16:17 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Wed, 13 Jun 2012 13:17:44 +0000 (13 16:17 +0300)
tree7e9af319ee82e3f30e1be936b4b2b0a4fe1b0e54
parent5d4ef4755276972f4b3c270ab755969c6fa6fdeb
buf_size: fix bytes_per_element() for strings and arrays

For string constants the call to get_type() returns NULL so that has to
be handled specially.

For arrays, it is still wrong to use ->ctype.alignment.  We could be
handling them the same as SYM_POINTER.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch_buf_size.c
validation/sm_buf_size4.c [new file with mode: 0644]