Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000828 [tweak] Any major always 01-14-05 07:44 01-25-05 13:25
Reporter andreas View Status public  
Assigned To bernd
Priority normal Resolution fixed  
Status resolved  
Summary 0000828: HostWindows: Window label needs terminating 0 character
Description ioSetTitleOfWindow() uses newTitle directly but newTitle does not include the terminating 0 character requrired in C. Simple to fix: Just copy the string into a buffer and add the terminating zero.
Additional Information
Attached Files

- Relationships

- Notes
(0001075 - 1081 - 1393 - 1393 - 1393 - 1393 - 1393)
tim
01-14-05 08:33

Just by way of a trivial reference, cf this code from RISC OS:-

int ioSetTitleOfWindow(int windowIndex, char * newTitle, int sizeOfTitle) {
/* ioSetTitleOfWindow: args are int windowIndex, char* newTitle and
 * int size of new title. Fail with -1 if windowIndex is invalid, string is too long for platform etc. Leave previous title in place on failure */
windowDescriptorBlock * thisWindow;
 thisWindow = (windowDescriptorBlock *)windowBlockFromIndex(windowIndex);
 if (thisWindow == NULL) {
  /* seems to be an invalid window index */
  return -1;
}
/* check the string length is ok */
 if ( sizeOfTitle > WindowTitleLength ) {
  return -1;
 }

 /* check the titlebar flag is set */
 if ((thisWindow->attributes | wimp_WINDOW_TITLE_ICON) == 0 ) {
  return -1;
}

 /* copy to the window */
 strncpy(thisWindow->title, newTitle, sizeOfTitle);
 thisWindow->title[sizeOfTitle] = '\0';
 /* update the titlebar if the window is built */
 if (thisWindow->handle) {
  xwimp_force_redraw_furniture(thisWindow->handle, wimp_FURNITURE_TITLE);
 }
 return true;
}
 
(0001098 - 88 - 88 - 88 - 88 - 88 - 88)
bernd
01-25-05 13:25

WinVM uses now a static buffer of 256 Byte for newTitle and adds there the terminating 0
 

- Issue History
Date Modified Username Field Change
01-14-05 07:44 andreas New Issue
01-14-05 07:45 andreas Status new => assigned
01-14-05 07:45 andreas Assigned To  => bernd
01-14-05 08:33 tim Note Added: 0001075
01-25-05 13:25 bernd Status assigned => resolved
01-25-05 13:25 bernd Resolution open => fixed
01-25-05 13:25 bernd Note Added: 0001098


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
41 total queries executed.
33 unique queries executed.
Powered by Mantis Bugtracker