30 lines
763 B
Plaintext
30 lines
763 B
Plaintext
$OpenBSD: patch-print_svg_c,v 1.1.1.1 2007/10/04 07:17:40 steven Exp $
|
|
--- print_svg.c.orig Sat Sep 22 20:21:19 2007
|
|
+++ print_svg.c Sat Sep 29 15:29:03 2007
|
|
@@ -7,6 +7,7 @@
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
+#include <err.h>
|
|
#include "sudoku.h"
|
|
|
|
/*
|
|
@@ -35,6 +36,7 @@ void sudokus_to_svg(char *fn, t_sudoku sudokus[4]) {
|
|
float pagePadH = (pageHeight - 6) - squareSize * (2*size+5);
|
|
|
|
float x0, y0;
|
|
+ FILE *f;
|
|
|
|
// svg file name
|
|
if (fn == NULL)
|
|
@@ -42,7 +44,8 @@ void sudokus_to_svg(char *fn, t_sudoku sudokus[4]) {
|
|
else
|
|
strcat(fn,".svg");
|
|
|
|
- FILE *f=fopen(fn,"w");
|
|
+ if ((f=fopen(fn,"w")) == NULL)
|
|
+ err(1, "fopen: %s", fn);
|
|
|
|
// print xml / svg head
|
|
fprintf(f,"<?xml version=\"1.0\" standalone=\"no\"?>\n\
|