Source
for(i = (int)len - 1; i >= 0 && HDisspace((int)str[i]) && str[i] == ' '; i--)
/****h* H5f90kit/H5f90kit
* PURPOSE
* Routines from HDF4 to deal with C-FORTRAN issues:
*
* HD5f2cstring -- convert a Fortran string to a C string
* HD5packFstring -- convert a C string into a Fortran string
*
* COPYRIGHT
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
******
*/
/****if* H5f90kit/HDf2cstring
* NAME
* HD5f2cstring -- convert a Fortran string to a C string
* char * HDf2cstring(fdesc, len)
* INPUTS
* _fcd fdesc; IN: Fortran string descriptor
* int len; IN: length of Fortran string
* RETURNS
* Pointer to the C string if success, else NULL
* PURPOSE
* Chop off trailing blanks off of a Fortran string and
* move it into a newly allocated C string. It is up
* to the user to free this string.
* SOURCE
*/
char *
HD5f2cstring(_fcd fdesc, size_t len)
/******/
{
char *cstr; /* C string to return */
char *str; /* Pointer to FORTRAN string */
int i; /* Local index variable */