Commit f201d7bd authored by Mike Hibler's avatar Mike Hibler

Avoid uninitialized variable.

parent 6d22c601
......@@ -1502,14 +1502,25 @@ sub check_progress($$)
# been exceeded.
#
my $cursize = (stat($fname))[7];
if ($usefup && !defined($cursize)) {
if (!defined($cursize)) {
#
# XXX avoid an ugly race.
# When done, frisuploadd moves foo.tmp -> foo
# If we didn't find foo.tmp, try foo now.
#
$fname =~ s/\.tmp$//;
$cursize = (stat($fname))[7];
if ($usefup) {
$fname =~ s/\.tmp$//;
$cursize = (stat($fname))[7];
}
#
# XXX avoid an ugly uninitialized value.
# This should not happen, since we created the file,
# but just in case, if the file doesn't exist set the size to 0.
# We will eventually timeout.
#
if (!defined($cursize)) {
$cursize = 0;
}
}
if ($cursize > $maximagesize) {
$result = "toobig";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment