Message243697
In reviewing calls to strcpy(<string>, ""), I found three instances which could be re-written as *<string> = '\0'; which would save the minor overhead of a function call. The patch file is below:
--- install.c.orig 2015-05-20 14:11:27.723397005 -0700
+++ install.c 2015-05-20 14:14:00.862860244 -0700
@@ -1640,8 +1640,8 @@
PSWIZB_BACK);
SetDlgItemText(hwnd, IDC_PATH, "");
SetDlgItemText(hwnd, IDC_INSTALL_PATH, "");
- strcpy(python_dir, "");
- strcpy(pythondll, "");
+ *python_dir = '\0'; /* replaces strcpy(python_dir, "") */
+ *pythondll = '\0'; /* replaces strcpy(pythondll, "") */
} else {
char *pbuf;
int result;
@@ -1680,7 +1680,7 @@
}
free(pbuf);
} else
- strcpy(pythondll, "");
+ *pythondll = '\0'; /* replaces strcpy(pythondll, "") */
/* retrieve the scheme for this version */
{
char install_path[_MAX_PATH];
I am attaching the patch file to this bug report... |
|
Date |
User |
Action |
Args |
2015-05-20 21:23:09 | dogbert2 | set | recipients:
+ dogbert2, tim.golden, zach.ware, steve.dower |
2015-05-20 21:23:09 | dogbert2 | set | messageid: <1432156989.27.0.220297051277.issue24250@psf.upfronthosting.co.za> |
2015-05-20 21:23:09 | dogbert2 | link | issue24250 messages |
2015-05-20 21:23:09 | dogbert2 | create | |
|