summaryrefslogtreecommitdiffstats
path: root/dimension
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-03-18 02:32:01 -0400
committerTavian Barnes <tavianator@gmail.com>2010-03-18 02:32:01 -0400
commit4d152ae3c3d292e009b6c0245905b3b99801fc96 (patch)
tree7d0a2261ec6d6ed95d01ef865cf11a276be9c065 /dimension
parentfc54151bbc6c81067c1d6c8ee752e6aad1ea984e (diff)
downloaddimension-4d152ae3c3d292e009b6c0245905b3b99801fc96.tar.xz
Fix some warnings reported by clang static analysis.
Diffstat (limited to 'dimension')
-rw-r--r--dimension/lexer.l2
-rw-r--r--dimension/main.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/dimension/lexer.l b/dimension/lexer.l
index d198b62..5a603ea 100644
--- a/dimension/lexer.l
+++ b/dimension/lexer.l
@@ -107,7 +107,7 @@
CALCULATE_COLUMN(); \
} while(0)
-int token;
+int token = DMNSN_T_LEX_ERROR;
size_t string_length = 0, string_extent = 8;
unsigned long wchar;
diff --git a/dimension/main.c b/dimension/main.c
index 53b8288..a03762f 100644
--- a/dimension/main.c
+++ b/dimension/main.c
@@ -89,6 +89,8 @@ main(int argc, char **argv) {
case 'w':
{
+ dmnsn_assert(optarg, "NULL argument.");
+
char *endptr;
width = strtoul(optarg, &endptr, 10);
if (*endptr != '\0' || endptr == optarg) {
@@ -99,6 +101,8 @@ main(int argc, char **argv) {
}
case 'h':
{
+ dmnsn_assert(optarg, "NULL argument.");
+
char *endptr;
height = strtoul(optarg, &endptr, 10);
if (*endptr != '\0' || endptr == optarg) {
@@ -110,6 +114,8 @@ main(int argc, char **argv) {
case DMNSN_OPT_THREADS:
{
+ dmnsn_assert(optarg, "NULL argument.");
+
char *endptr;
nthreads = strtoul(optarg, &endptr, 10);
if (*endptr != '\0' || endptr == optarg) {