--- a/src/vips/plug.c
+++ b/src/vips/plug.c
@@ -10,13 +10,11 @@
 {	
 	IMAGE *out;
 	char *transformFile;
-	int *imgNr;
 	int i;
 	
 	out = argv[0];
 	transformFile = argv[1];
-	imgNr = argv[2];
-	i = *imgNr;
+	i = *((int *) argv[2]);
 	
 	if( transform_image( out, transformFile, i) )
 		return( -1 );