diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-01-10 04:09:34 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-01-10 04:09:34 +0000 |
| commit | ea7e430219d044b73473dd2782e741f8582688f9 (patch) | |
| tree | 9438e09a90d9622872a5249a04b76fce878d93bd /macosx/plugins/DFNet/macsrc/PluginConfigController.m | |
| parent | f9cb1c85ed195c205d7bb48b69c83a7838cb9aa2 (diff) | |
Changing some things on the OS X net plug-in.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@82167 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/plugins/DFNet/macsrc/PluginConfigController.m')
| -rwxr-xr-x | macosx/plugins/DFNet/macsrc/PluginConfigController.m | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/macosx/plugins/DFNet/macsrc/PluginConfigController.m b/macosx/plugins/DFNet/macsrc/PluginConfigController.m index bc6ae94b..b0444e9a 100755 --- a/macosx/plugins/DFNet/macsrc/PluginConfigController.m +++ b/macosx/plugins/DFNet/macsrc/PluginConfigController.m @@ -22,14 +22,14 @@ #import "PluginConfigController.h" #include "dfnet.h" -#define kIPADDRKEY @"IP Address" -#define kIPPORT @"IP Port" -#define kPLAYERNUM @"Player Number" +NSString * const kIPADDRKEY = @"IP Address"; +NSString * const kIPPORT = @"IP Port"; +NSString * const kPLAYERNUM = @"Player Number"; #define APP_ID @"net.codeplex.pcsxr.DFNet" #define PrefsKey APP_ID @" Settings" -static PluginConfigController *windowController; +static PluginConfigController *windowController = nil; void AboutDlgProc() { @@ -82,7 +82,7 @@ void ReadConfig() NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [defaults registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys: - [NSMutableDictionary dictionaryWithObjectsAndKeys: + [NSDictionary dictionaryWithObjectsAndKeys: @"127.0.0.1",kIPADDRKEY, [NSNumber numberWithInt:33306], kIPPORT, [NSNumber numberWithInt:1], kPLAYERNUM, @@ -92,7 +92,7 @@ void ReadConfig() conf.PortNum = [[keyValues objectForKey:kIPPORT] intValue]; conf.PlayerNum = [[keyValues objectForKey:kPLAYERNUM] intValue]; - strcpy(conf.ipAddress, [[keyValues objectForKey:kIPADDRKEY] cStringUsingEncoding:NSASCIIStringEncoding]); + strlcpy(conf.ipAddress, [[keyValues objectForKey:kIPADDRKEY] cStringUsingEncoding:NSASCIIStringEncoding], sizeof(conf.ipAddress)); } @implementation PluginConfigController @@ -100,6 +100,8 @@ void ReadConfig() - (IBAction)cancel:(id)sender { [self close]; + [windowController release]; + windowController = nil; } - (IBAction)ok:(id)sender @@ -119,6 +121,8 @@ void ReadConfig() ReadConfig(); [self close]; + [windowController release]; + windowController = nil; } - (void)loadValues |
