www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/10/30/21:16:57

To: tony AT nt DOT tuwien DOT ac DOT at
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: strcat() ?
Date: Mon, 31 Oct 1994 10:15:04 +1100
From: Peter Horan <peter AT deakin DOT edu DOT au>

> I would like to know what 
> 
> strcat(a, b);
> 
> should do when b happens to be NULL.
> I assume it should do nothing at all. Until v1.11m5 it did nothing, but
> using v1.12m2 I had to change to
> 
> if(b)
>   strcat(a,b);
> 
> to avoid concatenating some funny (nonprintable) characters to a.
> Is there any possibility to find out what libc-functions do, when an
> argument (pointer) is NULL ?

The C library string functions have an unstated precondition that string 
pointers are not NULL. It is up to the user to ensure this. strcat() will not 
test your arguments.

> 
> Tony
> 
> ============================================================================
> Dipl.-Ing. Anton HELM             **    Private:
> Institut fuer Nachrichtentechnik  **    
> und Hochfrequenztechnik           **    Anton HELM
> Guszhausstr. 25/389               **    Gratian-Marx Str. 7/27
> A-1040 Wien                       **    A-1110 Wien
> AUSTRIA                           **    AUSTRIA  
>                                   **
> Tel.: +43-1-58801-3520            **
> FAX : +43-1-5870583               **
> email: Anton DOT Helm AT nt DOT tuwien DOT ac DOT at **
>        tony AT nt DOT tuwien DOT ac DOT at       **                                  
>    ________   __    __           __        __   __   _______   __        __
>   /__   __/  / /   / /          / /       / /  / /  / _____/  /  \      / /
>     /  /    / /   / /  _____   / /  __   / /  / /  / /____   / /\ \    / /
>    /  /    / /   / /  /____/  / /  / /  / /  / /  / _____/  / /  \ \  / /
>   /  /    / /___/ /          / /__/ /__/ /  / /  / /____   / /    \ \/ /
>  /__/    /_______/          /___________/  /_/  /______/  /_/      \__/

Peter Horan                     School of Computing and Mathematics
peter AT deakin DOT edu DOT au	   	Deakin University
                                Geelong
+61-52-27 1234 (Voice)          Victoria 3217
+61-52-27 2028 (FAX)            Australia


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019