Mailinglist Archive: yast-commit (535 mails)
| < Previous | Next > |
[yast-commit] r41193 - in /trunk/liby2util/src: Pathname.cc include/y2util/stringutil.h
- From: mvidner@xxxxxxxxxxxxxxxx
- Date: Tue, 02 Oct 2007 13:22:09 -0000
- Message-id: <20071002132209.C953E2FBD7@xxxxxxxxxxxxxxxx>
Author: mvidner
Date: Tue Oct 2 15:22:09 2007
New Revision: 41193
URL: http://svn.opensuse.org/viewcvs/yast?rev=41193&view=rev
Log:
fixed some warnings
Modified:
trunk/liby2util/src/Pathname.cc
trunk/liby2util/src/include/y2util/stringutil.h
Modified: trunk/liby2util/src/Pathname.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/liby2util/src/Pathname.cc?rev=41193&r1=41192&r2=41193&view=diff
==============================================================================
--- trunk/liby2util/src/Pathname.cc (original)
+++ trunk/liby2util/src/Pathname.cc Tue Oct 2 15:22:09 2007
@@ -143,8 +143,8 @@
// check for prefix
if ( name_t.length() >= 2
&& name_t[1] == ':'
- && ( 'a' <= name_t[0] && name_t[0] <= 'z'
- || 'A' <= name_t[0] && name_t[0] <= 'Z' ) ) {
+ && ( ( 'a' <= name_t[0] && name_t[0] <= 'z' )
+ || ( 'A' <= name_t[0] && name_t[0] <= 'Z' ) ) ) {
Tprfx = name_t.substr( 0, 2 );
prfx_i = 2;
R_pci += 2;
Modified: trunk/liby2util/src/include/y2util/stringutil.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/liby2util/src/include/y2util/stringutil.h?rev=41193&r1=41192&r2=41193&view=diff
==============================================================================
--- trunk/liby2util/src/include/y2util/stringutil.h (original)
+++ trunk/liby2util/src/include/y2util/stringutil.h Tue Oct 2 15:22:09 2007
@@ -25,6 +25,7 @@
#include <cstdio>
#include <cstdarg>
+#include <cstdlib>
#include <iosfwd>
#include <vector>
@@ -65,8 +66,8 @@
va_start( ap, format );
#if 1
- vasprintf( &buf, format, ap );
- if ( buf ) {
+ int numprinted = vasprintf( &buf, format, ap );
+ if ( numprinted >= 0 ) {
val = buf;
free( buf );
}
@@ -265,7 +266,7 @@
inline std::list<std::string> splitToLines( const std::string text_r, const std::string & sep_r = "\n" )
{
std::vector<std::string> lines;
- stringutil::split( text_r, lines, "\n", true );
+ stringutil::split( text_r, lines, sep_r, true );
std::list<std::string> ret;
for ( unsigned i = 0; i < lines.size(); ++i ) {
ret.push_back( lines[i] );
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx
Date: Tue Oct 2 15:22:09 2007
New Revision: 41193
URL: http://svn.opensuse.org/viewcvs/yast?rev=41193&view=rev
Log:
fixed some warnings
Modified:
trunk/liby2util/src/Pathname.cc
trunk/liby2util/src/include/y2util/stringutil.h
Modified: trunk/liby2util/src/Pathname.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/liby2util/src/Pathname.cc?rev=41193&r1=41192&r2=41193&view=diff
==============================================================================
--- trunk/liby2util/src/Pathname.cc (original)
+++ trunk/liby2util/src/Pathname.cc Tue Oct 2 15:22:09 2007
@@ -143,8 +143,8 @@
// check for prefix
if ( name_t.length() >= 2
&& name_t[1] == ':'
- && ( 'a' <= name_t[0] && name_t[0] <= 'z'
- || 'A' <= name_t[0] && name_t[0] <= 'Z' ) ) {
+ && ( ( 'a' <= name_t[0] && name_t[0] <= 'z' )
+ || ( 'A' <= name_t[0] && name_t[0] <= 'Z' ) ) ) {
Tprfx = name_t.substr( 0, 2 );
prfx_i = 2;
R_pci += 2;
Modified: trunk/liby2util/src/include/y2util/stringutil.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/liby2util/src/include/y2util/stringutil.h?rev=41193&r1=41192&r2=41193&view=diff
==============================================================================
--- trunk/liby2util/src/include/y2util/stringutil.h (original)
+++ trunk/liby2util/src/include/y2util/stringutil.h Tue Oct 2 15:22:09 2007
@@ -25,6 +25,7 @@
#include <cstdio>
#include <cstdarg>
+#include <cstdlib>
#include <iosfwd>
#include <vector>
@@ -65,8 +66,8 @@
va_start( ap, format );
#if 1
- vasprintf( &buf, format, ap );
- if ( buf ) {
+ int numprinted = vasprintf( &buf, format, ap );
+ if ( numprinted >= 0 ) {
val = buf;
free( buf );
}
@@ -265,7 +266,7 @@
inline std::list<std::string> splitToLines( const std::string text_r, const std::string & sep_r = "\n" )
{
std::vector<std::string> lines;
- stringutil::split( text_r, lines, "\n", true );
+ stringutil::split( text_r, lines, sep_r, true );
std::list<std::string> ret;
for ( unsigned i = 0; i < lines.size(); ++i ) {
ret.push_back( lines[i] );
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx
| < Previous | Next > |