text: /* TEMPLATE GENERATED TESTCASE FILE
  Filename: CWE197_Numeric_Truncation_Error__int_large_to_char_63b.c
  Label Definition File: CWE197_Numeric_Truncation_Error__int.label.xml
  Template File: sources-sink-63b.tmpl.c
  */
  /*
   * @description
   * CWE: 197 Numeric Truncation Error
   * BadSource: large Set data to a number larger than SHRT_MAX
   * GoodSource: Less than CHAR_MAX
   * Sinks: to_char
   *    BadSink : Convert data to a char
   * Flow Variant: 63 Data flow: pointer to data passed from one function to another in different source files
   *
   * */
  
  #include "std_testcase.h"
  
  #ifndef OMITBAD
  
  void CWE197_Numeric_Truncation_Error__int_large_to_char_63b_badSink(int * dataPtr)
  {
      int data = *dataPtr;
      {
          /* POTENTIAL FLAW: Convert data to a char, possibly causing a truncation error */
          char charData = (char)data;
          printHexCharLine(charData);
      }
  }
  
  #endif /* OMITBAD */
  
  #ifndef OMITGOOD
  
  /* goodG2B uses the GoodSource with the BadSink */
  void CWE197_Numeric_Truncation_Error__int_large_to_char_63b_goodG2BSink(int * dataPtr)
  {
      int data = *dataPtr;
      {
          /* POTENTIAL FLAW: Convert data to a char, possibly causing a truncation error */
          char charData = (char)data;
          printHexCharLine(charData);
      }
  }
  
  #endif /* OMITGOOD */
  