white space and quiet warning

This commit is contained in:
Isaac Connor 2018-11-17 10:39:42 -05:00
parent d99ee73ad3
commit 87140ecdb5
2 changed files with 33 additions and 33 deletions

View File

@ -174,7 +174,7 @@ Event::Event(
Error("Can't mkdir %s: %s", path, strerror(errno));
}
} else {
path_ptr += snprintf(path, sizeof(path), "/%" PRIu64, id);
snprintf(path, sizeof(path), "/%" PRIu64, id);
if ( mkdir(path, 0755) ) {
if ( errno != EEXIST )
Error("Can't mkdir %s: %s", path, strerror(errno));

View File

@ -62,39 +62,39 @@ $minY = 0;
$maxY = $monitor->Height()-1;
if ( !isset($newZone) ) {
if ( $zid > 0 ) {
$zone = dbFetchOne( 'SELECT * FROM Zones WHERE MonitorId = ? AND Id=?', NULL, array( $monitor->Id(), $zid ) );
} else {
$zone = array(
'Id' => 0,
'Name' => translate('New'),
'Type' => 'Active',
'MonitorId' => $monitor->Id(),
'NumCoords' => 4,
'Coords' => sprintf( "%d,%d %d,%d, %d,%d %d,%d", $minX, $minY, $maxX, $minY, $maxX, $maxY, $minX, $maxY ),
'Area' => $monitor->Width() * $monitor->Height(),
'AlarmRGB' => 0xff0000,
'CheckMethod' => 'Blobs',
'MinPixelThreshold' => '',
'MaxPixelThreshold' => '',
'MinAlarmPixels' => '',
'MaxAlarmPixels' => '',
'FilterX' => '',
'FilterY' => '',
'MinFilterPixels' => '',
'MaxFilterPixels' => '',
'MinBlobPixels' => '',
'MaxBlobPixels' => '',
'MinBlobs' => '',
'MaxBlobs' => '',
'OverloadFrames' => '',
'ExtendAlarmFrames' => '',
);
}
$zone['Points'] = coordsToPoints( $zone['Coords'] );
$zone['AreaCoords'] = preg_replace( '/\s+/', ',', $zone['Coords'] );
if ( $zid > 0 ) {
$zone = dbFetchOne( 'SELECT * FROM Zones WHERE MonitorId = ? AND Id=?', NULL, array( $monitor->Id(), $zid ) );
} else {
$zone = array(
'Id' => 0,
'Name' => translate('New'),
'Type' => 'Active',
'MonitorId' => $monitor->Id(),
'NumCoords' => 4,
'Coords' => sprintf( "%d,%d %d,%d, %d,%d %d,%d", $minX, $minY, $maxX, $minY, $maxX, $maxY, $minX, $maxY ),
'Area' => $monitor->Width() * $monitor->Height(),
'AlarmRGB' => 0xff0000,
'CheckMethod' => 'Blobs',
'MinPixelThreshold' => '',
'MaxPixelThreshold' => '',
'MinAlarmPixels' => '',
'MaxAlarmPixels' => '',
'FilterX' => '',
'FilterY' => '',
'MinFilterPixels' => '',
'MaxFilterPixels' => '',
'MinBlobPixels' => '',
'MaxBlobPixels' => '',
'MinBlobs' => '',
'MaxBlobs' => '',
'OverloadFrames' => '',
'ExtendAlarmFrames' => '',
);
}
$zone['Points'] = coordsToPoints( $zone['Coords'] );
$zone['AreaCoords'] = preg_replace( '/\s+/', ',', $zone['Coords'] );
$newZone = $zone;
$newZone = $zone;
} # end if new Zone
# Ensure Zone fits within the limits of the Monitor