Difference between revisions of "Team 5 Bugs Report"
(Created page with 'On local machine, while compiling, ncursor.h : No such file or directory (library not existing yet)') |
|||
(10 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | On local machine, while compiling, | + | * On local machine (Windows), while compiling with GCC, |
ncursor.h : No such file or directory | ncursor.h : No such file or directory | ||
− | (library not existing | + | (GNU library not existing on Windows platform by default) |
+ | * String Overlapping during strncpy() causing memory corruption. | ||
+ | if ((int)strlen(str)>fieldLen){ | ||
+ | char * strOut; | ||
+ | //strOut = new char[fieldLen + 1]; | ||
+ | strncpy(strOut, str, fieldLen); | ||
+ | strOut[fieldLen]='\0'; | ||
+ | // ... | ||
+ | //delete [] strOut; | ||
+ | } | ||
+ | |||
+ | ( Commented being the fix) | ||
+ | |||
+ | Bug Report (Tai Nguyen/25/09/2013) | ||
+ | - display function completed, no bugs found | ||
+ | - edit function problem | ||
+ | |||
+ | '''Objective: move cursor left and right with arrow keys (LEFT, RIGHT)''' | ||
+ | '''Issue: when typing, cannot insert correct values and cannot use left and right keys''' | ||
+ | '''Solution: Using arrays to store the current positions causes issues with the console input.. not sure why.. but when removed array - currPos and used normal variable int to store the row and column current position it worked...''' | ||
+ | |||
+ | code attempt: | ||
+ | do{ | ||
+ | console.getPosition(currPos[0], currPos[1]); | ||
+ | console >> key; | ||
+ | if(key >= ' ' && key <= '~'){ | ||
+ | console << key; | ||
+ | }else if(key == LEFT){ | ||
+ | console.setPosition(currPos[0], currPos[1] - 1); | ||
+ | }else if(key == RIGHT){ | ||
+ | console.setPosition(currPos[0], currPos[1] + 1); | ||
+ | } | ||
+ | }while(key != ESCAPE); | ||
+ | However if re-written as, it performs as desired: | ||
+ | do{ | ||
+ | console >> key; | ||
+ | if(key >= ' ' && key <= '~'){ | ||
+ | console << key; | ||
+ | }else if(key == LEFT){ | ||
+ | console.getPosition(currPos[0], currPos[1]); | ||
+ | console.setPosition(currPos[0], currPos[1] - 1); | ||
+ | }else if(key == RIGHT){ | ||
+ | console.getPosition(currPos[0], currPos[1]); | ||
+ | console.setPosition(currPos[0], currPos[1] + 1); | ||
+ | } | ||
+ | }while(key != ESCAPE); | ||
+ | |||
+ | Bug Report (Tai Nguyen/Yiqi 28/09/2013) | ||
+ | - We noticed a problem on putty/ssh that the home button key does not register in the a1test.cpp compile run |
Latest revision as of 16:54, 6 November 2013
- On local machine (Windows), while compiling with GCC,
ncursor.h : No such file or directory
(GNU library not existing on Windows platform by default)
- String Overlapping during strncpy() causing memory corruption.
if ((int)strlen(str)>fieldLen){ char * strOut; //strOut = new char[fieldLen + 1]; strncpy(strOut, str, fieldLen); strOut[fieldLen]='\0'; // ... //delete [] strOut; }
( Commented being the fix)
Bug Report (Tai Nguyen/25/09/2013) - display function completed, no bugs found - edit function problem
Objective: move cursor left and right with arrow keys (LEFT, RIGHT) Issue: when typing, cannot insert correct values and cannot use left and right keys
Solution: Using arrays to store the current positions causes issues with the console input.. not sure why.. but when removed array - currPos and used normal variable int to store the row and column current position it worked...
code attempt: do{ console.getPosition(currPos[0], currPos[1]); console >> key; if(key >= ' ' && key <= '~'){ console << key; }else if(key == LEFT){ console.setPosition(currPos[0], currPos[1] - 1); }else if(key == RIGHT){ console.setPosition(currPos[0], currPos[1] + 1); } }while(key != ESCAPE); However if re-written as, it performs as desired: do{ console >> key; if(key >= ' ' && key <= '~'){ console << key; }else if(key == LEFT){ console.getPosition(currPos[0], currPos[1]); console.setPosition(currPos[0], currPos[1] - 1); }else if(key == RIGHT){ console.getPosition(currPos[0], currPos[1]); console.setPosition(currPos[0], currPos[1] + 1); } }while(key != ESCAPE);
Bug Report (Tai Nguyen/Yiqi 28/09/2013) - We noticed a problem on putty/ssh that the home button key does not register in the a1test.cpp compile run