comparison win/dw.c @ 608:e49524bc2f07

Fix trailing junk on dw_mle_export()
author mhessling@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 01 Oct 2006 04:40:02 +0000
parents d3871f747160
children bc800fc67343
comparison
equal deleted inserted replaced
607:b4cb30f47a97 608:e49524bc2f07
5884 5884
5885 /* 5885 /*
5886 * Grabs text from an MLE box. 5886 * Grabs text from an MLE box.
5887 * Parameters: 5887 * Parameters:
5888 * handle: Handle to the MLE to be queried. 5888 * handle: Handle to the MLE to be queried.
5889 * buffer: Text buffer to be exported. 5889 * buffer: Text buffer to be exported. MUST allow for trailing nul character.
5890 * startpoint: Point to start grabbing text. 5890 * startpoint: Point to start grabbing text.
5891 * length: Amount of text to be grabbed. 5891 * length: Amount of text to be grabbed.
5892 */ 5892 */
5893 void API dw_mle_export(HWND handle, char *buffer, int startpoint, int length) 5893 void API dw_mle_export(HWND handle, char *buffer, int startpoint, int length)
5894 { 5894 {
5903 if(startpoint < len) 5903 if(startpoint < len)
5904 { 5904 {
5905 max = MIN(length, len - startpoint); 5905 max = MIN(length, len - startpoint);
5906 5906
5907 memcpy(buffer, &tmpbuf[startpoint], max); 5907 memcpy(buffer, &tmpbuf[startpoint], max);
5908 buffer[max] = '\0';
5908 } 5909 }
5909 5910
5910 free(tmpbuf); 5911 free(tmpbuf);
5911 } 5912 }
5912 5913