From f0604b952ac4fa3fa840859b87b0536c9924a544 Mon Sep 17 00:00:00 2001 From: Uwe Schulzweida <uwe.schulzweida@mpimet.mpg.de> Date: Fri, 8 Apr 2016 09:20:29 +0000 Subject: [PATCH] unitsIsPressure: replace memcmp by strncmp --- src/Makefile.in | 2 +- src/stream_cdf.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Makefile.in b/src/Makefile.in index 36e2b0574..bcc7f8791 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -942,8 +942,8 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -@ENABLE_CDI_LIB_FALSE@install-exec-local: @ENABLE_CDI_LIB_FALSE@uninstall-local: +@ENABLE_CDI_LIB_FALSE@install-exec-local: clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ diff --git a/src/stream_cdf.c b/src/stream_cdf.c index 17c0a2779..46a86ad47 100644 --- a/src/stream_cdf.c +++ b/src/stream_cdf.c @@ -3090,11 +3090,11 @@ bool unitsIsPressure(const char *units) { bool status = false; - if ( memcmp(units, "millibar", 8) == 0 || - memcmp(units, "mb", 2) == 0 || - memcmp(units, "hectopas", 8) == 0 || - memcmp(units, "hPa", 3) == 0 || - memcmp(units, "Pa", 2) == 0 ) + if ( strncmp(units, "millibar", 8) == 0 || + strncmp(units, "mb", 2) == 0 || + strncmp(units, "hectopas", 8) == 0 || + strncmp(units, "hPa", 3) == 0 || + strncmp(units, "Pa", 2) == 0 ) { status = true; } -- GitLab