aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rwxr-xr-xlib/checksrc.pl9
-rw-r--r--lib/checksrc.whitelist4
-rw-r--r--lib/formdata.c4
3 files changed, 15 insertions, 2 deletions
diff --git a/lib/checksrc.pl b/lib/checksrc.pl
index 292ad3424..8fad2cfcb 100755
--- a/lib/checksrc.pl
+++ b/lib/checksrc.pl
@@ -228,6 +228,15 @@ sub scanfile {
"use of $2 is banned");
}
+ # scan for use of non-binary fopen without the macro
+ if($l =~ /^(.*\W)fopen\s*\([^"]*\"([^"]*)/) {
+ my $mode = $2;
+ if($mode !~ /b/) {
+ checkwarn($line, length($1), $file, $l,
+ "use of non-binary fopen without FOPEN_* macro");
+ }
+ }
+
# check for open brace first on line but not first column
# only alert if previous line ended with a close paren and wasn't a cpp
# line
diff --git a/lib/checksrc.whitelist b/lib/checksrc.whitelist
index da7b75dc0..e261b9da1 100644
--- a/lib/checksrc.whitelist
+++ b/lib/checksrc.whitelist
@@ -4,3 +4,7 @@
150 Opening ASCII mode data connection for [file] (0.0.0.0,0) (545 bytes)
* no_proxy=domain1.dom,host.domain2.dom
Default values are (0,0) initialized by calloc.
+ file = fopen(name, "r"); /* VMS */
+ return fopen(file, "r"); /* VMS */
+ return fopen(file, "r", "rfm=stmlf", "ctx=stm");
+ curl_memlog("FILE %s:%d fopen(\"%s\",\"%s\") = %p\n",
diff --git a/lib/formdata.c b/lib/formdata.c
index cd98f3c6f..9e8ce4ea0 100644
--- a/lib/formdata.c
+++ b/lib/formdata.c
@@ -756,7 +756,7 @@ curl_off_t VmsRealFileSize(const char * name,
int ret_stat;
FILE * file;
- file = fopen(name, "r");
+ file = fopen(name, "r"); /* VMS */
if(file == NULL)
return 0;
@@ -1385,7 +1385,7 @@ static FILE * vmsfopenread(const char *file, const char *mode) {
case FAB$C_VAR:
case FAB$C_VFC:
case FAB$C_STMCR:
- return fopen(file, "r");
+ return fopen(file, "r"); /* VMS */
break;
default:
return fopen(file, "r", "rfm=stmlf", "ctx=stm");