@@ -241,16 +241,15 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)
241241 /* Check out named files first */
242242 for (i = 0 ; i < argc ; i ++ ) {
243243 const char * arg = argv [i ];
244- const char * p ;
244+ char * p ;
245245
246246 if (all )
247247 die ("git checkout-index: don't mix '--all' and explicit filenames" );
248248 if (read_from_stdin )
249249 die ("git checkout-index: don't mix '--stdin' and explicit filenames" );
250250 p = prefix_path (prefix , prefix_length , arg );
251251 checkout_file (p , prefix );
252- if (p < arg || p > arg + strlen (arg ))
253- free ((char * )p );
252+ free (p );
254253 }
255254
256255 if (read_from_stdin ) {
@@ -260,7 +259,7 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)
260259 die ("git checkout-index: don't mix '--all' and '--stdin'" );
261260
262261 while (strbuf_getline (& buf , stdin , line_termination ) != EOF ) {
263- const char * p ;
262+ char * p ;
264263 if (line_termination && buf .buf [0 ] == '"' ) {
265264 strbuf_reset (& nbuf );
266265 if (unquote_c_style (& nbuf , buf .buf , NULL ))
@@ -269,8 +268,7 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)
269268 }
270269 p = prefix_path (prefix , prefix_length , buf .buf );
271270 checkout_file (p , prefix );
272- if (p < buf .buf || p > buf .buf + buf .len )
273- free ((char * )p );
271+ free (p );
274272 }
275273 strbuf_release (& nbuf );
276274 strbuf_release (& buf );
0 commit comments