Kaydet (Commit) 5680906c authored tarafından Guido van Rossum's avatar Guido van Rossum

Change all three fopen calls to use binary mode.

üst 05bc4af4
...@@ -249,7 +249,7 @@ sizeofimage(self, args) ...@@ -249,7 +249,7 @@ sizeofimage(self, args)
if (!PyArg_Parse(args, "s", &name)) if (!PyArg_Parse(args, "s", &name))
return NULL; return NULL;
inf = fopen(name, "r"); inf = fopen(name, "rw");
if (!inf) { if (!inf) {
PyErr_SetString(ImgfileError, "can't open image file"); PyErr_SetString(ImgfileError, "can't open image file");
return NULL; return NULL;
...@@ -289,7 +289,7 @@ longimagedata(self, args) ...@@ -289,7 +289,7 @@ longimagedata(self, args)
if (!PyArg_Parse(args, "s", &name)) if (!PyArg_Parse(args, "s", &name))
return NULL; return NULL;
inf = fopen(name,"r"); inf = fopen(name,"rb");
if (!inf) { if (!inf) {
PyErr_SetString(ImgfileError, "can't open image file"); PyErr_SetString(ImgfileError, "can't open image file");
return NULL; return NULL;
...@@ -594,7 +594,7 @@ longstoimage(self, args) ...@@ -594,7 +594,7 @@ longstoimage(self, args)
return NULL; return NULL;
goodwrite = 1; goodwrite = 1;
outf = fopen(name, "w"); outf = fopen(name, "wb");
if (!outf) { if (!outf) {
PyErr_SetString(ImgfileError, "can't open output file"); PyErr_SetString(ImgfileError, "can't open output file");
return NULL; return NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment