IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 6, 2004, 2:06:06 PM (22 years ago)
Author:
desonia
Message:

another attempt to get astyle to get it right.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/sys/psString.c

    r1406 r1407  
     1
    12/** @file  psString.c
    23 *
     
    89 *  @author Eric Van Alst, MHPCC
    910 *   
    10  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2004-08-06 22:34:05 $
     11 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-08-07 00:06:06 $
    1213 *
    1314 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    1516
    1617/******************************************************************************/
     18
    1719/*  INCLUDE FILES                                                             */
     20
    1821/******************************************************************************/
    1922#include <stdlib.h>
     
    2427
    2528/******************************************************************************/
     29
    2630/*  DEFINE STATEMENTS                                                         */
     31
    2732/******************************************************************************/
    2833
     
    3035
    3136/******************************************************************************/
     37
    3238/*  TYPE DEFINITIONS                                                          */
     39
    3340/******************************************************************************/
    3441
     
    3643
    3744/*****************************************************************************/
     45
    3846/*  GLOBAL VARIABLES                                                         */
     47
    3948/*****************************************************************************/
    4049
     
    4251
    4352/*****************************************************************************/
     53
    4454/*  FILE STATIC VARIABLES                                                    */
     55
    4556/*****************************************************************************/
    4657
     
    4859
    4960/*****************************************************************************/
     61
    5062/*  FUNCTION IMPLEMENTATION - LOCAL                                          */
     63
    5164/*****************************************************************************/
    5265
     
    5467
    5568/*****************************************************************************/
     69
    5670/* FUNCTION IMPLEMENTATION - PUBLIC                                          */
     71
    5772/*****************************************************************************/
    5873
    59 char *psStringCopy(
    60     const char*  str
    61 )
     74char *psStringCopy(const char *str)
    6275{
    6376    // Allocate memory using psAlloc function
     
    6780}
    6881
    69 char *psStringNCopy(
    70     const char*  str,
    71     int          nChar
    72 )
     82char *psStringNCopy(const char *str, int nChar)
    7383{
    7484    char *returnValue = NULL;
    7585
    7686    // Check the number of characters to copy is non-negative
    77     if ( nChar < 0 ) {
     87    if (nChar < 0) {
    7888        // Log error message and return NULL
    79         psError(__FILE__,"psStringNCopy with negative count specified %d",
    80                 nChar);
     89        psError(__FILE__, "psStringNCopy with negative count specified %d", nChar);
    8190        return NULL;
    8291    }
     
    8493    // Copy input string to memory allocated up to nChar characters
    8594    // Return the copy
    86     returnValue = strncpy(psAlloc((size_t)nChar + 1), str, (size_t)nChar);
     95    returnValue = strncpy(psAlloc((size_t) nChar + 1), str, (size_t) nChar);
    8796
    8897    // Ensure the last byte is NULL character
    89     if ( nChar > 0 ) {
    90         returnValue[nChar-1] = '\0';
     98    if (nChar > 0) {
     99        returnValue[nChar - 1] = '\0';
    91100    }
    92 
    93101    // Return the string pointer
    94102    return returnValue;
    95103}
    96 
    97 
Note: See TracChangeset for help on using the changeset viewer.