Skip to content

Commit

Permalink
daemon: fix error when exceeding nPlugs
Browse files Browse the repository at this point in the history
  • Loading branch information
xkonni committed Nov 25, 2012
1 parent d3e3600 commit e0caf86
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,10 @@ int main(int argc, char* argv[]) {
*/
int nAddr = getAddr(nGroup, nSwitchNumber);
char msg[13];
if (nAddr > nPlugs)
printf("Switch invalid: %s::%d\n", nGroup, nSwitchNumber);
if (nAddr > nPlugs) {
printf("Switch out of range: %s:%d\n", nGroup, nSwitchNumber);
n = write(newsockfd,"2",1);
}
else {
switch (nAction) {
/**
Expand Down

0 comments on commit e0caf86

Please sign in to comment.