On 5 Sep 2002, Michel Arboi wrote:

> "Pavel Kankovsky" <[EMAIL PROTECTED]> writes:
> 
> > It appears many existing NASL scripts use string() to concatenate strings.
> 
> c=a+b; works and should be used instead, right.

Not good enough:

a = "0";
b = "1";
display(a + b, "\n");

returns 1 not 01

Apparently, this is the only safe way to concatenate two strings
of arbitrary binary data (unless I know both values are purified):

  r = "";
  for (__i = 0; __i < strlen(a); __i = __i + 1)
    r = string(__r, raw_string(ord(a[__i])));
  for (__i = 0; __i < strlen(b); __i = __i + 1)
    r = string(__r, raw_string(ord(b[__i])));

Or am I wrong?

--Pavel Kankovsky aka Peak
"Welcome to the Czech Republic. Bring your own lifeboats."

-
[EMAIL PROTECTED]: general discussions about Nessus.
* To unsubscribe, send a mail to [EMAIL PROTECTED] with
"unsubscribe nessus" in the body.

Reply via email to