Added
Link Here
|
1 |
--- src/GUI/ots_gui.c.orig Sun Apr 2 22:56:24 2006 |
2 |
+++ src/GUI/ots_gui.c Sat Apr 8 19:46:40 2006 |
3 |
@@ -1026,7 +1026,7 @@ |
4 |
} |
5 |
else |
6 |
{ |
7 |
- sprintf(tmpstr,"%s%s", invocation_path, strg); |
8 |
+ snprintf(tmpstr, sizeof(tmpstr), "%s%s", invocation_path, strg); |
9 |
printf("Setting Tax Program to be: '%s'\n", tmpstr); |
10 |
taxsolvecmd = strdup(tmpstr); |
11 |
strcpy(taxsolvestrng,tmpstr); |
12 |
@@ -1037,8 +1037,8 @@ |
13 |
if (k>0) k--; |
14 |
while ((k>0) && (tmpstr[k]!=slashchr)) k--; |
15 |
if (tmpstr[k]==slashchr) tmpstr[k+1] = '\0'; |
16 |
- else {sprintf(tmpstr,".%c", slashchr);} |
17 |
- sprintf(directory_dat,"%sexamples_and_templates%c", tmpstr, slashchr); |
18 |
+ else {snprintf(tmpstr, sizeof(tmpstr), ".%c", slashchr);} |
19 |
+ snprintf(directory_dat, sizeof(directory_dat), "%sexamples_and_templates%c", "%%PREFIX%%/share/ots/", slashchr); |
20 |
/* CA_540 MA_1 NC_400 NJ_1040 NY_IT201 OH_1040 PA_40 US_1040 US_1040_Sched_C VA_760 */ |
21 |
if (strstr(strg,"CA_540")) strcat(directory_dat,"CA_540"); else |
22 |
if (strstr(strg,"MA_1")) strcat(directory_dat,"MA_1"); else |
23 |
@@ -1118,7 +1118,7 @@ |
24 |
main_panel = |
25 |
OtkMakePanel( OtkOuterWindow, Otk_Raised, Otk_LightGray, 1, 7.5, 98, 87 ); /* Main Panel. */ |
26 |
Otk_SetBorderThickness( main_panel, 0.25 ); |
27 |
- sprintf(tmpstr,"%s..%csrc%cGUI%cotslogo.ppm", invocation_path, slashchr, slashchr, slashchr ); |
28 |
+ snprintf(tmpstr, sizeof(tmpstr), "%%PREFIX%%/share/ots/otslogo.ppm"); |
29 |
subpanel = OtkMakePanel( main_panel, Otk_Raised, Otk_LightGray, 20, 2, 60, 20 ); |
30 |
testfile = fopen(tmpstr,"r"); |
31 |
if (testfile!=0) |