- Status Closed
- Percent Complete
- Task Type Bugs
- Category Games
- Assigned To No-one
- Operating System All players
- Severity Low
- Priority Very Low
- Reported Version Daily build (which?)
- Due in Version Undecided
-
Due Date
Undecided
- Votes
- Private
Attached to Project: Rockbox
Opened by daniel.weck - 2007-09-09
Last edited by jdgordon - 2008-08-19
Opened by daniel.weck - 2007-09-09
Last edited by jdgordon - 2008-08-19
FS#7740 - Chess:error in pl_malloc,missing update of remaining size in plugin buffer for pseudo dynamic alloc.
In chessbox_pgn.c, the bufleft variable is never updated to reflect the actual size left in the plugin buffer for pseudo dynamic allocation. The original code is:
/* global vars for pl_malloc() */
void *bufptr = NULL;
ssize_t bufleft;
/* simple function to “allocate” memory in pluginbuffer.
* (borrowed from dict.c)
*/
void *pl_malloc(ssize_t size)
{
void *ptr; ptr = bufptr;
if (bufleft < size) { return NULL; } else { bufptr += size; return ptr; }
}
/* init function for pl_malloc() */
void pl_malloc_init(void)
{
bufptr = rb->plugin_get_buffer((size_t *)&bufleft);
}
In pl_malloc(), the bufleft variable should be updated as such:
…
else { bufptr += size;
bufleft -= size;
return ptr; }
…
Closed by jdgordon
2008-08-19 12:16
Reason for closing: Accepted
Additional comments about closing: Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407
2008-08-19 12:16
Reason for closing: Accepted
Additional comments about closing: Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407
thanks :)
Loading...
Available keyboard shortcuts
- Alt + ⇧ Shift + l Login Dialog / Logout
- Alt + ⇧ Shift + a Add new task
- Alt + ⇧ Shift + m My searches
- Alt + ⇧ Shift + t focus taskid search
Tasklist
- o open selected task
- j move cursor down
- k move cursor up
Task Details
- n Next task
- p Previous task
- Alt + ⇧ Shift + e ↵ Enter Edit this task
- Alt + ⇧ Shift + w watch task
- Alt + ⇧ Shift + y Close Task
Task Editing
- Alt + ⇧ Shift + s save task
I forgot to say: this code is copied from dict.c, so the both the Chess and Dict plugins are affected by this.