Version 4.0.2.1, tag libreoffice-4.0.2.1
[LibreOffice.git] / lpsolve / lp_solve-fixed-warn.patch
blob46742887a85fad4b4a7eda8e003e7a9ae149b974
1 --- misc/build/lp_solve_5.5/lp_report.c 2007-01-14 10:31:34.000000000 -0800
2 +++ misc/build/lp_solve_5.5/lp_report.c 2007-01-14 10:31:34.000000000 -0800
3 @@ -160,7 +160,7 @@
5 int i, k = 0;
7 - fprintf(output, label);
8 + fputs(label, output);
9 fprintf(output, "\n");
10 for(i = first; i <= last; i++) {
11 fprintf(output, " %18g", vector[i]);
12 @@ -189,7 +189,7 @@
13 if(last < 0)
14 last = lp->rows;
16 - fprintf(output, label);
17 + fputs(label, output);
18 fprintf(output, "\n");
20 if(first == 0) {
21 @@ -254,7 +254,7 @@
22 if(last < 0)
23 last = lp->rows;
25 - fprintf(output, label);
26 + fputs(label, output);
27 fprintf(output, "\n");
29 for(i = first; i <= last; i++) {
30 --- misc/build/lp_solve_5.5/lp_rlp.h 2007-01-14 10:31:52.000000000 -0800
31 +++ misc/build/lp_solve_5.5/lp_rlp.h 2007-01-14 10:31:52.000000000 -0800
32 @@ -615,7 +615,7 @@
33 /* This used to be an fputs(), but since the string might contain NUL's,
34 * we now use fwrite().
36 -#define ECHO (void) fwrite( lp_yytext, lp_yyleng, 1, lp_yyout )
37 +#define ECHO if(fwrite( lp_yytext, lp_yyleng, 1, lp_yyout ) != 1) YY_FATAL_ERROR( "can't write into lp_yytext" )
38 #endif
40 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
41 --- misc/build/lp_solve_5.5/shared/commonlib.c 2007-01-14 10:33:14.000000000 -0800
42 +++ misc/build/lp_solve_5.5/shared/commonlib.c 2007-01-14 10:33:14.000000000 -0800
43 @@ -715,7 +715,7 @@
45 int i, k = 0;
47 - fprintf(output, label);
48 + fputs(label, output);
49 fprintf(output, "\n");
50 for(i = first; i <= last; i++) {
51 fprintf(output, " %5d", myvector[i]);
52 @@ -734,7 +734,7 @@
54 int i, k = 0;
56 - fprintf(output, label);
57 + fputs(label, output);
58 fprintf(output, "\n");
59 for(i = first; i <= last; i++) {
60 if(asRaw)
61 @@ -756,7 +756,7 @@
63 int i, k = 0;
65 - fprintf(output, label);
66 + fputs(label, output);
67 fprintf(output, "\n");
68 for(i = first; i <= last; i++) {
69 fprintf(output, " %18g", myvector[i]);
70 --- misc/build/lp_solve_5.5/shared/mmio.c 2007-01-14 10:33:14.000000000 -0800
71 +++ misc/build/lp_solve_5.5/shared/mmio.c 2007-01-14 10:33:14.000000000 -0800
72 @@ -74,7 +74,11 @@
74 for (i=0; i<nz; i++)
76 - fscanf(f, "%d %d %lg\n", &I[i], &J[i], &val[i]);
77 + if(fscanf(f, "%d %d %lg\n", &I[i], &J[i], &val[i]) != 3)
78 + {
79 + fprintf(stderr, "read_unsymmetric_sparse(): could not parse values.\n");
80 + return -1;
81 + }
82 I[i]--; /* adjust from 1-based to 0-based */
83 J[i]--;