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

From 2d6c6477a18f5bcc10e7c823d932b1083f0238bf 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 | 10 ++++++++++
 1 file changed, 10 insertions(+)

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