]> git.saurik.com Git - apple/mdnsresponder.git/blobdiff - mDNSWindows/DNSServiceBrowser/WindowsCE/Sources/BrowserDialog.cpp
mDNSResponder-878.200.35.tar.gz
[apple/mdnsresponder.git] / mDNSWindows / DNSServiceBrowser / WindowsCE / Sources / BrowserDialog.cpp
index 2bdd05b38f48b0d3f4cf4d98bcb1dede254c346d..67b9cb85d9d4829a88ecf9de1d3b5867b27f1984 100644 (file)
@@ -1,51 +1,19 @@
-/*
+/* -*- Mode: C; tab-width: 4 -*-
+ *
  * Copyright (c) 2002-2004 Apple Computer, Inc. All rights reserved.
  *
  * Copyright (c) 2002-2004 Apple Computer, Inc. All rights reserved.
  *
- * @APPLE_LICENSE_HEADER_START@
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
  * 
  * 
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
+ *     http://www.apache.org/licenses/LICENSE-2.0
  * 
  * 
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
  * limitations under the License.
  * limitations under the License.
- * 
- * @APPLE_LICENSE_HEADER_END@
-
-    Change History (most recent first):
-    
-$Log: BrowserDialog.cpp,v $
-Revision 1.2  2004/07/13 21:24:27  rpantos
-Fix for <rdar://problem/3701120>.
-
-Revision 1.1  2004/06/18 04:04:37  rpantos
-Move up one level
-
-Revision 1.5  2004/01/30 02:56:33  bradley
-Updated to support full Unicode display. Added support for all services on www.dns-sd.org.
-
-Revision 1.4  2003/10/16 09:21:56  bradley
-Ignore non-IPv4 resolves until mDNS on Windows supports IPv6.
-
-Revision 1.3  2003/10/14 03:28:50  bradley
-Insert services in sorted order to make them easier to find. Defer service adds/removes to the main
-thread to avoid potential problems with multi-threaded MFC message map access. Added some asserts.
-
-Revision 1.2  2003/10/10 03:43:34  bradley
-Added support for launching a web browser to go to the browsed web site on a single-tap.
-
-Revision 1.1  2003/08/21 02:16:10  bradley
-DNSServiceBrowser for HTTP services for Windows CE/PocketPC.
-
-*/
+ */
 
 #include       "stdafx.h"
 
 
 #include       "stdafx.h"
 
@@ -90,7 +58,7 @@ BrowserDialog::BrowserDialog( CWnd *inParent )
        : CDialog( BrowserDialog::IDD, inParent )
 {
        //{{AFX_DATA_INIT(BrowserDialog)
        : CDialog( BrowserDialog::IDD, inParent )
 {
        //{{AFX_DATA_INIT(BrowserDialog)
-               // NOTE: the ClassWizard will add member initialization here
+               // Note: the ClassWizard will add member initialization here
        //}}AFX_DATA_INIT
        
        // Note that LoadIcon does not require a subsequent DestroyIcon in Win32.
        //}}AFX_DATA_INIT
        
        // Note that LoadIcon does not require a subsequent DestroyIcon in Win32.
@@ -236,7 +204,7 @@ void
                        {
                                char            ip[ 64 ];
 
                        {
                                char            ip[ 64 ];
 
-                               sprintf( ip, "%u.%u.%u.%u:%u", 
+                               snprintf( ip, sizeof( ip ), "%u.%u.%u.%u:%u", 
                                        inEvent->data.resolved->address.u.ipv4.addr.v8[ 0 ], 
                                        inEvent->data.resolved->address.u.ipv4.addr.v8[ 1 ], 
                                        inEvent->data.resolved->address.u.ipv4.addr.v8[ 2 ], 
                                        inEvent->data.resolved->address.u.ipv4.addr.v8[ 0 ], 
                                        inEvent->data.resolved->address.u.ipv4.addr.v8[ 1 ], 
                                        inEvent->data.resolved->address.u.ipv4.addr.v8[ 2 ],