Fixed the build under BeOS/Dano:
* setenv() actually exists in Dano. * On R5, it now uses sprintf() - the previous version would not compile. * Cleaned some weird code in TermBuffer.cpp to set the "buf" variable to the end of the string - it also no longer uses the index() BSD extension (same as strchr()). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21793 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -86,7 +86,7 @@
|
||||
/*
|
||||
* Set environment variable.
|
||||
*/
|
||||
#if !defined(__HAIKU__) || defined(HAIKU_TARGET_PLATFORM_LIBBE_TEST)
|
||||
#if defined(HAIKU_TARGET_PLATFORM_BEOS) || defined(HAIKU_TARGET_PLATFORM_LIBBE_TEST)
|
||||
|
||||
extern char **environ;
|
||||
|
||||
@@ -102,7 +102,7 @@ setenv(const char *var, const char *value, bool overwrite)
|
||||
/* found it */
|
||||
if (overwrite) {
|
||||
environ[envindex] = (char *)malloc((unsigned)len + val_len + 2);
|
||||
snprintf(environ[envindex], "%s=%s", var, value);
|
||||
sprintf(environ[envindex], "%s=%s", var, value);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
static bool sUsageRequested = false;
|
||||
|
||||
@@ -200,7 +200,7 @@ TermBuffer::GetString(int row, int col, int num, uchar *buf,
|
||||
if (ptr->attr != (ptr + 1)->attr)
|
||||
return all_count;
|
||||
|
||||
buf = (uchar *)index((char *)buf, 0x00);
|
||||
buf += strlen((char *)buf);
|
||||
ptr++;
|
||||
col++;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user