~ubuntu-branches/ubuntu/natty/clamav/natty-updates

« back to all changes in this revision

Viewing changes to libclamav/strrcpy.c

  • Committer: Bazaar Package Importer
  • Author(s): Stephen Gran
  • Date: 2004-06-21 22:26:45 UTC
  • Revision ID: james.westby@ubuntu.com-20040621222645-jvaxzuttrjz6kh8t
Tags: upstream-0.73
ImportĀ upstreamĀ versionĀ 0.73

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright (C) 2002 Nigel Horne <njh@bandsman.co.uk>
 
3
 *
 
4
 *  This program is free software; you can redistribute it and/or modify
 
5
 *  it under the terms of the GNU General Public License as published by
 
6
 *  the Free Software Foundation; either version 2 of the License, or
 
7
 *  (at your option) any later version.
 
8
 *
 
9
 *  This program is distributed in the hope that it will be useful,
 
10
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 *  GNU General Public License for more details.
 
13
 *
 
14
 *  You should have received a copy of the GNU General Public License
 
15
 *  along with this program; if not, write to the Free Software
 
16
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
17
 */
 
18
 
 
19
#include <stdio.h>
 
20
#include <assert.h>
 
21
 
 
22
/*
 
23
 * Like strcpy, but return the END of the destination, allowing a quicker
 
24
 * means of adding to the end of a string than strcat
 
25
 */
 
26
char *
 
27
strrcpy(char *dest, const char *source)
 
28
{
 
29
        /* Pre assertions */
 
30
        assert(dest != NULL);
 
31
        assert(source != NULL);
 
32
        assert(dest != source);
 
33
 
 
34
        /* tk: parentheses */
 
35
        while((*dest++ = *source++))
 
36
                ;
 
37
        return(--dest);
 
38
}