49 lines
1.5 KiB
Diff
49 lines
1.5 KiB
Diff
--- sudoku.c 2015-03-13 16:20:28.000000000 +0100
|
|
+++ sudoku.c 2017-12-22 19:44:59.484598329 +0100
|
|
@@ -369,7 +369,8 @@
|
|
static int opt_solve = 0;
|
|
static int opt_restrict = 0;
|
|
|
|
-static FILE default_template_file; /* We will use only the address of it. */
|
|
+/* We will use only the address of it. */
|
|
+static FILE* default_template_file = (FILE *)0x000000001;
|
|
static int default_template_siz = 0;
|
|
static int default_template_pos = 0;
|
|
|
|
@@ -384,7 +385,7 @@
|
|
&& strcmp(mode, "r") == 0) {
|
|
stream = fopen(filename, "r");
|
|
if (0 == stream && strcmp(TEMPLATE_FALLBACK, filename) == 0) {
|
|
- stream = &default_template_file;
|
|
+ stream = default_template_file;
|
|
default_template_siz = sizeof(default_template) * 4;
|
|
default_template_pos = 0;
|
|
}
|
|
@@ -397,7 +398,7 @@
|
|
tclose (FILE * stream)
|
|
{
|
|
int ret = -1;
|
|
- if (stream == &default_template_file) {
|
|
+ if (stream == default_template_file) {
|
|
default_template_siz = 0;
|
|
default_template_pos = 0;
|
|
ret = 0;
|
|
@@ -414,7 +415,7 @@
|
|
int origin)
|
|
{
|
|
int ret = -1;
|
|
- if (stream != &default_template_file) {
|
|
+ if (stream != default_template_file) {
|
|
ret = fseek(stream,
|
|
offset,
|
|
origin);
|
|
@@ -454,7 +455,7 @@
|
|
FILE * stream)
|
|
{
|
|
char * ret = 0;
|
|
- if (stream == &default_template_file) {
|
|
+ if (stream == default_template_file) {
|
|
int i = 0;
|
|
if (str != 0
|
|
&& n > 0
|