Ticket #40242

sprintf2

Date d'ouverture: 2020-03-10 01:05 Dernière mise à jour: 2020-03-10 01:58

Rapporteur:
(Anonyme)
Propriétaire:
(Aucun)
Type:
État:
Ouvert
Composant:
Jalon:
(Aucun)
Priorité:
5 - moyen
Sévérité:
5 - moyen
Résolution:
Aucun
Fichier:
Aucun
Vote
Score: 0
No votes
0.0% (0/0)
0.0% (0/0)

Détails

The sprintf2 command, when duplicated arguments are used, is seen to occasionally use 1 instead of 0 for the first argument value. An example:

foo = 0
sprintf2 bar '00 %s 00 00 %s 00' foo foo
bar becomes '00 01 00 00 00 00'

Below a workaround. I've gone for Medium for Priority and Milestone as can be worked around as below.

foo = 0
foo2 = foo
sprintf2 bar '00 %s 00 00 %s 00'  foo foo2
bar becomes '00 00 00 00 00 00'

Unknown, is whether the observed issue is more general. For example, affecting multiple arguments, with problem seen with first argument, or perhaps all bar last argument. And/or affecting different intended and/or seen values, as well as just respective 0 and 1. And perhaps affecting sprintf command too.

Ticket History (3/5 Histories)

2020-03-10 01:05 Updated by: None
  • New Ticket "sprintf2" created
2020-03-10 01:09 Updated by: None
Commentaire

Corrected formatting:

The sprintf2 command, when duplicated arguments are used, is seen to occasionally use 1 instead of 0 for the first argument value. An example:

foo = 0

sprintf2 bar '00 %s 00 00 %s 00' foo foo

bar becomes '00 01 00 00 00 00'

Below a workaround. I've gone for Medium for Priority and Milestone as can be worked around as below.

foo = 0

foo2 = foo

sprintf2 bar '00 %s 00 00 %s 00' foo foo2

bar becomes '00 00 00 00 00 00'

Unknown, is whether the observed issue is more general. For example, affecting multiple arguments, with problem seen with first argument, or perhaps all bar last argument. And/or affecting different intended and/or seen values, as well as just respective 0 and 1. And perhaps affecting sprintf command too.

2020-03-10 01:13 Updated by: None
Commentaire

Corrected formatting, and code:

The sprintf2 command, when duplicated arguments are used, is seen to occasionally use other value for first argument. An example:

foo = '00'

sprintf2 bar '00 %s 00 00 %s 00' foo foo

bar becomes '00 01 00 00 00 00'

Below a workaround. I've gone for Medium for Priority and Milestone as can be worked around as below.

foo = '00'

foo2 = foo

sprintf2 bar '00 %s 00 00 %s 00' foo foo2

bar becomes '00 00 00 00 00 00'

Unknown, is whether the observed issue is more general. For example, affecting multiple arguments, with problem seen with first argument, or perhaps all bar last argument. And/or affecting different intended and/or seen values, as well as just those above. And perhaps affecting sprintf command too.

2020-03-10 01:56 Updated by: doda
  • Details Updated
Commentaire

'%s' accepts a string value, not a integer value.

use '%d' instead.

e.g.

foo = 0
sprintf2 bar '00 %02d 00 00 %02d 00' foo foo
messagebox bar "bar"

2020-03-10 01:58 Updated by: doda
Commentaire

(匿名) への返信

foo = '00'
sprintf2 bar '00 %s 00 00 %s 00' foo foo
bar becomes '00 01 00 00 00 00'

Not reproduced.

Which version are you using?

Attachment File List

No attachments

Modifier

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Connexion