src/win32.cpp
changeset 10310 ca2eb5811a07
parent 10301 76966696a338
equal deleted inserted replaced
10309:a3519caf1001 10310:ca2eb5811a07
   801 	/* WinCE only knows one drive: / */
   801 	/* WinCE only knows one drive: / */
   802 	FiosItem *fios = _fios_items.Append();
   802 	FiosItem *fios = _fios_items.Append();
   803 	fios->type = FIOS_TYPE_DRIVE;
   803 	fios->type = FIOS_TYPE_DRIVE;
   804 	fios->mtime = 0;
   804 	fios->mtime = 0;
   805 	snprintf(fios->name, lengthof(fios->name), PATHSEP "");
   805 	snprintf(fios->name, lengthof(fios->name), PATHSEP "");
   806 	ttd_strlcpy(fios->title, fios->name, lengthof(fios->title));
   806 	strecpy(fios->title, fios->name, lastof(fios->title));
   807 #else
   807 #else
   808 	TCHAR drives[256];
   808 	TCHAR drives[256];
   809 	const TCHAR *s;
   809 	const TCHAR *s;
   810 
   810 
   811 	GetLogicalDriveStrings(lengthof(drives), drives);
   811 	GetLogicalDriveStrings(lengthof(drives), drives);
   812 	for (s = drives; *s != '\0';) {
   812 	for (s = drives; *s != '\0';) {
   813 		FiosItem *fios = _fios_items.Append();
   813 		FiosItem *fios = _fios_items.Append();
   814 		fios->type = FIOS_TYPE_DRIVE;
   814 		fios->type = FIOS_TYPE_DRIVE;
   815 		fios->mtime = 0;
   815 		fios->mtime = 0;
   816 		snprintf(fios->name, lengthof(fios->name),  "%c:", s[0] & 0xFF);
   816 		snprintf(fios->name, lengthof(fios->name),  "%c:", s[0] & 0xFF);
   817 		ttd_strlcpy(fios->title, fios->name, lengthof(fios->title));
   817 		strecpy(fios->title, fios->name, lastof(fios->title));
   818 		while (*s++ != '\0') { /* Nothing */ }
   818 		while (*s++ != '\0') { /* Nothing */ }
   819 	}
   819 	}
   820 #endif
   820 #endif
   821 }
   821 }
   822 
   822 
  1125 	} else if (IsClipboardFormatAvailable(CF_TEXT)) {
  1125 	} else if (IsClipboardFormatAvailable(CF_TEXT)) {
  1126 		OpenClipboard(NULL);
  1126 		OpenClipboard(NULL);
  1127 		cbuf = GetClipboardData(CF_TEXT);
  1127 		cbuf = GetClipboardData(CF_TEXT);
  1128 
  1128 
  1129 		ptr = (const char*)GlobalLock(cbuf);
  1129 		ptr = (const char*)GlobalLock(cbuf);
  1130 		ttd_strlcpy(utf8_buf, FS2OTTD(ptr), lengthof(utf8_buf));
  1130 		strecpy(utf8_buf, FS2OTTD(ptr), lastof(utf8_buf));
  1131 
  1131 
  1132 		GlobalUnlock(cbuf);
  1132 		GlobalUnlock(cbuf);
  1133 		CloseClipboard();
  1133 		CloseClipboard();
  1134 #endif /* UNICODE */
  1134 #endif /* UNICODE */
  1135 	} else {
  1135 	} else {