[70985] trunk/base/src/pextlib1.0/curl.c

raimue at macports.org raimue at macports.org
Sat Aug 28 18:56:14 PDT 2010


Revision: 70985
          http://trac.macports.org/changeset/70985
Author:   raimue at macports.org
Date:     2010-08-28 18:56:12 -0700 (Sat, 28 Aug 2010)
Log Message:
-----------
pextlib: Use Tcl_AppendResult instead of snprintf

Modified Paths:
--------------
    trunk/base/src/pextlib1.0/curl.c

Modified: trunk/base/src/pextlib1.0/curl.c
===================================================================
--- trunk/base/src/pextlib1.0/curl.c	2010-08-29 01:48:26 UTC (rev 70984)
+++ trunk/base/src/pextlib1.0/curl.c	2010-08-29 01:56:12 UTC (rev 70985)
@@ -190,10 +190,8 @@
 					break;
 				}
 			} else {
-				char theErrorString[512];
-				(void) snprintf(theErrorString, sizeof(theErrorString),
-					"curl fetch: unknown option %s", theOption);
-				Tcl_SetResult(interp, theErrorString, TCL_VOLATILE);
+				Tcl_ResetResult(interp);
+				Tcl_AppendResult("curl fetch: unknown option ", theOption, NULL);
 				theResult = TCL_ERROR;
 				break;
 			}
@@ -470,10 +468,8 @@
 			if (strcmp(theOption, "--ignore-ssl-cert") == 0) {
 				ignoresslcert = 1;
 			} else {
-				char theErrorString[512];
-				(void) snprintf(theErrorString, sizeof(theErrorString),
-					"curl isnewer: unknown option %s", theOption);
-				Tcl_SetResult(interp, theErrorString, TCL_VOLATILE);
+				Tcl_ResetResult(interp);
+				Tcl_AppendResult("curl isnewer: unknown option ", theOption, NULL);
 				theResult = TCL_ERROR;
 				break;
 			}
@@ -706,10 +702,8 @@
 			if (strcmp(theOption, "--ignore-ssl-cert") == 0) {
 				ignoresslcert = 1;
 			} else {
-				char theErrorString[512];
-				(void) snprintf(theErrorString, sizeof(theErrorString),
-					"curl getsize: unknown option %s", theOption);
-				Tcl_SetResult(interp, theErrorString, TCL_VOLATILE);
+				Tcl_ResetResult(interp);
+				Tcl_AppendResult("curl getsize: unknown option ", theOption, NULL);
 				theResult = TCL_ERROR;
 				break;
 			}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100828/3d7912b9/attachment.html>


More information about the macports-changes mailing list