jcs
/wifi_da
/amendments
/15
main: Use vsnprintf now that we have util
jcs made amendment 15 about 1 year ago
--- main.c Mon Oct 23 10:01:45 2023
+++ main.c Tue Oct 24 09:52:14 2023
@@ -126,14 +126,13 @@ da_open(void)
BlockMove(*(h = GetCursor(watchCursor)), &watch, sizeof(Cursor));
if (dispose)
ReleaseResource((Handle)h);
-
+
dce->dCtlMenu = menuID = OwnedResourceID(MAIN_MENU_ID);
menu = GetMenu(menuID);
(**menu).menuID = menuID;
InsertMenu(menu = GetMenu(menuID), 0);
-
DrawMenuBar();
-
+
dce->dCtlWindow = create_window(dce->dCtlRefNum);
HiliteMenu(0);
@@ -165,6 +164,10 @@ da_close(void)
dce->dCtlMenu = 0;
DisposeMenu(menu);
destroy_window();
+ if (logger) {
+ DisposeWindow(logger);
+ logger = 0;
+ }
dce->dCtlWindow = 0;
da_state = STATE_CLOSED;
}
@@ -274,7 +277,7 @@ logger_vprintf(const char *format, va_list ap)
GrafPtr savePort;
ssize_t len;
- len = vsprintf(buf, format, ap);
+ len = vsnprintf(buf, sizeof(buf), format, ap);
GetPort(&savePort);
SetPort(logger);