From f02ecc4e4cf3860c6f3d833bfb549df1adab7764 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Thu, 29 Oct 2015 16:31:17 +0100 Subject: [PATCH] Don't use ?: without the middle argument. --- test.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test.c b/test.c index 3491e29..d138fd6 100644 --- a/test.c +++ b/test.c @@ -25,7 +25,7 @@ long outpktno; long dropfrom; long dropto; double reorder; -long reorder_dist; +long reorder_dist = 10; double dropin; double dropout; long total_out; @@ -110,12 +110,12 @@ int main(int argc, char *argv[]) { bool server = argc == 2; bool connected = false; - dropin = atof(getenv("DROPIN") ?: "0"); - dropout = atof(getenv("DROPOUT") ?: "0"); - dropfrom = atoi(getenv("DROPFROM") ?: "0"); - dropto = atoi(getenv("DROPTO") ?: "0"); - reorder = atof(getenv("REORDER") ?: "0"); - reorder_dist = atoi(getenv("REORDER_DIST") ?: "10"); + if(getenv("DROPIN")) dropin = atof(getenv("DROPIN")); + if(getenv("DROPOUT")) dropout = atof(getenv("DROPOUT")); + if(getenv("DROPFROM")) dropfrom = atoi(getenv("DROPFROM")); + if(getenv("DROPTO")) dropto = atoi(getenv("DROPTO")); + if(getenv("REORDER")) reorder = atof(getenv("REORDER")); + if(getenv("REORDER_DIST")) reorder_dist = atoi(getenv("REORDER_DIST")); if(dropto < dropfrom) dropto = 1 << 30; -- 2.39.5