Print this page
10101 audio tools need smatch fixes

@@ -21,10 +21,14 @@
 /*
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
+/*
+ * Copyright (c) 2018, Joyent, Inc.
+ */
+
 /* Command-line audio record utility */
 
 #include <stdio.h>
 #include <libgen.h>
 #include <errno.h>

@@ -771,11 +775,11 @@
                 for (cp = s; *cp && (isdigit(*cp) || (*cp == '.')); cp++)
                         /* NOP */;
                 if (*cp != NULL) {
                         if ((*cp == 'k') || (*cp == 'K')) {
                                 drate *= 1000.0;
-                        } else if ((*cp != 'h') || (*cp != 'H')) {
+                        } else if ((*cp != 'h') && (*cp != 'H')) {
                                 /* bogus! */
                                 Error(stderr,
                                     MGET("invalid sample rate: %s\n"), s);
                                 return (1);
                         }