CLEO Help Last char

CLEO related
Status
Not open for further replies.

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
Where is the problem?
why i get crash?

[shcode=cpp]
   IF
   0AD4: $NOT_USED = scan_string 2@ format "[Kid]%s %s %s stup%s" $NOT_USED 5@v 6@v $NOT_USED
   THEN
       0C17: 2@ = strlen 6@ 
       IF
       2@ > 4
       THEN
           2@ -= 1
           0C24: strncpy destination 6@ source 6@ size 2@
           say 6@
       END
   END
[/shcode]
 

Edvincik

Well-known member
Joined
Mar 15, 2016
Messages
399
Reaction score
26
Parazitas said:
Where is the problem?
why i get crash?

[shcode=cpp]
   IF
   0AD4: $NOT_USED = scan_string 2@ format "[Kid]%s %s %s stup%s" $NOT_USED 5@v 6@v $NOT_USED
   THEN
       0C17: 2@ = strlen 6@ 
       IF
       2@ > 4
       THEN
           2@ -= 1
           0C24: strncpy destination 6@ source 6@ size 2@
           say 6@
       END
   END
[/shcode]

Allocate memory for all @
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
Malchik said:
Parazitas said:
Where is the problem?
why i get crash?

[shcode=cpp]
   IF
   0AD4: $NOT_USED = scan_string 2@ format "[Kid]%s %s %s stup%s" $NOT_USED 5@v 6@v $NOT_USED
   THEN
       0C17: 2@ = strlen 6@ 
       IF
       2@ > 4
       THEN
           2@ -= 1
           0C24: strncpy destination 6@ source 6@ size 2@
           say 6@
       END
   END
[/shcode]

Allocate memory for all @
problem incoming not from alloc...
 
Status
Not open for further replies.
Top