SDL_net: showinterfaces.c: added missing SDLNet_Init() and SDLNet_Quit() calls. (3079e)

From 3079ee39e1224d744fdedc066280690c8ec40bb1 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Tue, 15 Nov 2022 11:56:40 +0300
Subject: [PATCH] showinterfaces.c: added missing SDLNet_Init() and
 SDLNet_Quit() calls.

---
 showinterfaces.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/showinterfaces.c b/showinterfaces.c
index c1a93c5..4de1d7b 100644
--- a/showinterfaces.c
+++ b/showinterfaces.c
@@ -30,6 +30,12 @@ int main(int argc, char *argv[])
 	(void) argc;
 	(void) argv;
 
+	if (SDLNet_Init() < 0) {
+		fprintf(stderr, "Couldn't initialize net: %s\n",
+				SDLNet_GetError());
+		return 1;
+	}
+
 	count = SDLNet_GetLocalAddresses(addresses, MAX_ADDRESSES);
 	printf("Found %d local addresses\n", count);
 	for (i = 0; i < count; ++i) {
@@ -40,5 +46,8 @@ int main(int argc, char *argv[])
 			(addresses[i].host >> 24) & 0xFF,
 			SDLNet_ResolveIP(&addresses[i]));
 	}
+
+	SDLNet_Quit();
+
 	return 0;
 }