Error on compile
#1

Hello all

I received this errors in compiler(until now they did not show up, now we've updated all the plugins /include)

Quote:

grandlarc.pwn(15669) : error 092: functions may not return arrays of unknown size (symbol "Adrian")
grandlarc.pwn(15684) : error 092: functions may not return arrays of unknown size (symbol "Adrian")
grandlarc.pwn(24675) : error 092: functions may not return arrays of unknown size (symbol "Adrian")
grandlarc.pwn(25111) : error 092: functions may not return arrays of unknown size (symbol "Adrian")
grandlarc.pwn(36495) : error 092: functions may not return arrays of unknown size (symbol "Adrian")
Pawn compiler 3.10.4 Copyright © 1997-2006, ITB CompuPhase


5 Errors.

Line 36495: Adrian(B, item, 0);

This is stock:
stock Adrian(playerid, string[], V)
{
new A, B, C;
if(!V)
{
switch(random(5))
{
case 0: V = 1;
case 1: V = 3;
case 2: V = 5;
case 3: V = 7;
case 4: V = 9;
}
PlayerInfo[playerid][pLoserLevel] = V;
}
switch(V)
{
case 1:
{
A = 3;
B = 4;
C = 7;
}
case 3:
{
A = 8;
B = 9;
C = 1;
}
case 5:
{
A = 3;
B = 7;
C = 4;
}
case 7:
{
A = 1;
B = 3;
C = 9;
}
case 9:
{
A = 5;
B = 2;
C = 6;
}
}
for(new i, l = strlen(string); i < l; i++)
{
switch(string[i])
{
case 48..57:
{
string[i] += A;
if(string[i] > 57) string[i] -= 10;
}
case 65..90:
{
string[i] += B;
if(string[i] > 90) string[i] -= 26;
}
case 97..122:
{
string[i] += C;
if(string[i] > 122) string[i] -= 26;
}
}
}
return string;
}

P.S: This stock is a hash password
Reply
#2

anyone?
Reply
#3

well, this work fine... until now... I updated my server to 0.3.8 rc and all plugins/ inc.. and received this errors..
Reply
#4

@Question: Dont return string, but instead just change the variable. Arrays are passed by reference by default.


I dont see the point of writing an own hash function.
First, it includes randomness, so for the same input it may output different results. This will definitely cause problems sooner or later.
Second, it is just character shifting, easy to analyze, and - even worse - symmetric. The "hash" can be converted back to the plain password. And the whole point of hashing is to prevent that. In terms of security this isnt any better than storing the plain passwords.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)