~ubuntu-branches/ubuntu/hardy/lmms/hardy

« back to all changes in this revision

Viewing changes to plugins/vst_base/communication.h

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2007-12-13 15:18:02 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20071213151802-f0my03t6wq0pzaci
Tags: 0.3.1-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Remove libwine-dev alternative in the Build-Depends.
  - Update maintainer field as per spec.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * communication.h - header file defining stuff concerning communication between
3
3
 *                   LVSL-server and -client
4
4
 *
5
 
 * Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
 
5
 * Copyright (c) 2005-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
6
6
 * 
7
7
 * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
8
8
 *
61
61
static inline std::string readString( int _fd = 0 )
62
62
{
63
63
        Sint16 len = readValue<Sint16>( _fd );
64
 
        char * sc = new char[len];
 
64
        char * sc = new char[len + 1];
65
65
        read( _fd, sc, len );
 
66
        sc[len] = '\0';
66
67
        std::string s( sc );
67
68
        delete[] sc;
68
69
        return( s );
73
74
 
74
75
static inline void writeString( const char * _str, int _fd = 1 )
75
76
{
76
 
        int len = strlen( _str ) + 1;
 
77
        int len = strlen( _str );
77
78
        writeValue<Sint16>( len, _fd );
78
79
        write( _fd, _str, len );
79
80
}