libnet: Fix Coverity ID 1634803 Dereference after null check
[samba4-gss.git] / source3 / script / strip_trail_ws.pl
blobc2c39e21e3cf09be1dc8839a156d5f9a99d5824a
1 #!/usr/bin/perl -w
3 open( INFILE, "$ARGV[0]" ) || die $@;
4 open( OUTFILE, ">$ARGV[0].new" ) || die $@;
6 while ( <INFILE> ) {
7 $_ =~ s/[ \t\r]*$//;
8 print OUTFILE "$_";
11 close( INFILE );
12 close( OUTFILE );
14 rename( "$ARGV[0].new", "$ARGV[0]" ) || die @_;
16 exit( 0 );