Skip to content

Commit 1b1afce

Browse files
committed
Fixed an impossible value for an undefined error in SetTemplate() method (thanks @JoshHawley for finding this one).
(cherry picked from commit aa06925)
1 parent e82aa34 commit 1b1afce

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: src/FPS_GT511C3.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -962,12 +962,12 @@ uint8_t FPS_GT511C3::GetTemplate(uint16_t id, uint8_t data[])
962962
// Parameter: the ID number to upload
963963
// Parameter: Check for duplicate fingerprints already on fps
964964
// Returns:
965-
// -1 - Undefined error (shouldn't ever happen)
966965
// 0 - Uploaded ok (no duplicate if enabled)
967966
// 1 - ID duplicated
968967
// 2 - Invalid position
969968
// 3 - Communications error
970969
// 4 - Device error
970+
// 5 - Undefined error (shouldn't ever happen)
971971
uint16_t FPS_GT511C3::SetTemplate(uint8_t tmplt[], uint16_t id, bool duplicateCheck)
972972
{
973973
#if FPS_DEBUG
@@ -1006,7 +1006,7 @@ uint16_t FPS_GT511C3::SetTemplate(uint8_t tmplt[], uint16_t id, bool duplicateCh
10061006
delete rp;
10071007
if (error == Response_Packet::ErrorCodes::NACK_COMM_ERR) return 3;
10081008
if (error == Response_Packet::ErrorCodes::NACK_DEV_ERR) return 4;
1009-
return -1; // Undefined error
1009+
return 5; // Undefined error
10101010
}
10111011
}
10121012
}

Diff for: src/FPS_GT511C3.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -336,12 +336,12 @@ class FPS_GT511C3
336336
// Parameter: the ID number to upload
337337
// Parameter: Check for duplicate fingerprints already on fps
338338
// Returns:
339-
// -1 - Undefined error (shouldn't ever happen)
340339
// 0 - Uploaded ok (no duplicate if enabled)
341340
// 1 - ID duplicated
342341
// 2 - Invalid position
343342
// 3 - Communications error
344343
// 4 - Device error
344+
// 5 - Undefined error (shouldn't ever happen)
345345
uint16_t SetTemplate(uint8_t tmplt[], uint16_t id, bool duplicateCheck);
346346
#ifndef __GNUC__
347347
#pragma endregion

0 commit comments

Comments
 (0)