From 8f3119fdb63fb911e2dcf3f527693ed4592527df Mon Sep 17 00:00:00 2001 From: giraffedata Date: Mon, 13 Oct 2008 01:58:39 +0000 Subject: Fix bug: never generates full white pixel git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@755 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- generator/pgmnoise.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'generator/pgmnoise.c') diff --git a/generator/pgmnoise.c b/generator/pgmnoise.c index 643f260f..af65a23b 100644 --- a/generator/pgmnoise.c +++ b/generator/pgmnoise.c @@ -55,7 +55,7 @@ int main(int argc, for (row = 0; row < rows; ++row) { unsigned int col; for (col = 0; col < cols; ++col) - destrow[col] = rand() % PGM_MAXMAXVAL; + destrow[col] = rand() % (PGM_MAXMAXVAL + 1); pgm_writepgmrow(stdout, destrow, cols, PGM_MAXMAXVAL, 0); } -- cgit 1.4.1