LCOV - code coverage report
Current view: top level - nsprpub/lib/libc/src - strcmp.c (source / functions) Hit Total Coverage
Test: output.info Lines: 6 10 60.0 %
Date: 2017-07-14 16:53:18 Functions: 0 0 -
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
       2             : /* This Source Code Form is subject to the terms of the Mozilla Public
       3             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       4             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
       5             : 
       6             : #include "plstr.h"
       7             : #include <string.h>
       8             : 
       9             : PR_IMPLEMENT(PRIntn)
      10             : PL_strcmp(const char *a, const char *b)
      11             : {
      12         472 :     if( (const char *)0 == a )
      13           0 :         return ((const char *)0 == b) ? 0 : -1;
      14         472 :     if( (const char *)0 == b )
      15           0 :         return 1;
      16             : 
      17         472 :     return (PRIntn)strcmp(a, b);
      18             : }
      19             : 
      20             : PR_IMPLEMENT(PRIntn)
      21             : PL_strncmp(const char *a, const char *b, PRUint32 max)
      22             : {
      23      192081 :     if( (const char *)0 == a )
      24           0 :         return ((const char *)0 == b) ? 0 : -1;
      25      192081 :     if( (const char *)0 == b )
      26           0 :         return 1;
      27             : 
      28      192081 :     return (PRIntn)strncmp(a, b, (size_t)max);
      29             : }

Generated by: LCOV version 1.13