resize-gd

changeset 17:159402d54c29 tip

replaced atoi with strtol, which is more secure
author meillo@marmaro.de
date Tue, 22 Jul 2008 10:07:27 +0200
parents 9674ada28cfe
children
files resize-gd.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line diff
     1.1 --- a/resize-gd.c	Wed Jun 25 15:03:00 2008 +0200
     1.2 +++ b/resize-gd.c	Tue Jul 22 10:07:27 2008 +0200
     1.3 @@ -118,10 +118,10 @@
     1.4  	}
     1.5  
     1.6  	/* parse width and height */
     1.7 -	sizeopt.w = atoi(argv[1]);
     1.8 +	sizeopt.w = (int) strtol(argv[1], (char**)NULL, 10);
     1.9  	c = strchr(argv[1], 'x');
    1.10  	if (c && c[1] != '\0') {
    1.11 -		sizeopt.h = atoi(c + 1);
    1.12 +		sizeopt.h = (int) strtol(c+1, (char**)NULL, 10);
    1.13  	} else {
    1.14  		sizeopt.h = -1;  /* keep aspect ratio */
    1.15  	}