mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 23:58:50 +00:00
Return "" for rune < 0 in strconv.
This commit is contained in:
+10
-10
@@ -7,8 +7,8 @@ Parses a boolean value from the input string
|
|||||||
|
|
||||||
**Inputs**
|
**Inputs**
|
||||||
- s: The input string
|
- s: The input string
|
||||||
- true: "1", "t", "T", "true", "TRUE", "True"
|
- true: "1", "t", "T", "true", "TRUE", "True"
|
||||||
- false: "0", "f", "F", "false", "FALSE", "False"
|
- false: "0", "f", "F", "false", "FALSE", "False"
|
||||||
- n: An optional pointer to an int to store the length of the parsed substring (default: nil)
|
- n: An optional pointer to an int to store the length of the parsed substring (default: nil)
|
||||||
|
|
||||||
**Returns**
|
**Returns**
|
||||||
@@ -203,7 +203,7 @@ Parses an unsigned 64-bit integer value from the input string without a prefix,
|
|||||||
**Inputs**
|
**Inputs**
|
||||||
- str: The input string to parse
|
- str: The input string to parse
|
||||||
- base: The base of the number system to use for parsing
|
- base: The base of the number system to use for parsing
|
||||||
- Must be between 1 and 16 (inclusive)
|
- Must be between 1 and 16 (inclusive)
|
||||||
- n: An optional pointer to an int to store the length of the parsed substring (default: nil)
|
- n: An optional pointer to an int to store the length of the parsed substring (default: nil)
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
@@ -264,8 +264,8 @@ Parses an unsigned 64-bit integer value from the input string, using the specifi
|
|||||||
**Inputs**
|
**Inputs**
|
||||||
- str: The input string to parse
|
- str: The input string to parse
|
||||||
- base: The base of the number system to use for parsing (default: 0)
|
- base: The base of the number system to use for parsing (default: 0)
|
||||||
- If base is 0, it will be inferred based on the prefix in the input string (e.g. '0x' for hexadecimal)
|
- If base is 0, it will be inferred based on the prefix in the input string (e.g. '0x' for hexadecimal)
|
||||||
- If base is not 0, it will be used for parsing regardless of any prefix in the input string
|
- If base is not 0, it will be used for parsing regardless of any prefix in the input string
|
||||||
- n: An optional pointer to an int to store the length of the parsed substring (default: nil)
|
- n: An optional pointer to an int to store the length of the parsed substring (default: nil)
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
@@ -339,8 +339,8 @@ Parses a signed integer value from the input string, using the specified base or
|
|||||||
**Inputs**
|
**Inputs**
|
||||||
- s: The input string to parse
|
- s: The input string to parse
|
||||||
- base: The base of the number system to use for parsing (default: 0)
|
- base: The base of the number system to use for parsing (default: 0)
|
||||||
- If base is 0, it will be inferred based on the prefix in the input string (e.g. '0x' for hexadecimal)
|
- If base is 0, it will be inferred based on the prefix in the input string (e.g. '0x' for hexadecimal)
|
||||||
- If base is not 0, it will be used for parsing regardless of any prefix in the input string
|
- If base is not 0, it will be used for parsing regardless of any prefix in the input string
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
@@ -382,8 +382,8 @@ Parses an unsigned integer value from the input string, using the specified base
|
|||||||
**Inputs**
|
**Inputs**
|
||||||
- s: The input string to parse
|
- s: The input string to parse
|
||||||
- base: The base of the number system to use for parsing (default: 0, inferred)
|
- base: The base of the number system to use for parsing (default: 0, inferred)
|
||||||
- If base is 0, it will be inferred based on the prefix in the input string (e.g. '0x' for hexadecimal)
|
- If base is 0, it will be inferred based on the prefix in the input string (e.g. '0x' for hexadecimal)
|
||||||
- If base is not 0, it will be used for parsing regardless of any prefix in the input string
|
- If base is not 0, it will be used for parsing regardless of any prefix in the input string
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
@@ -1729,7 +1729,7 @@ quote_rune :: proc(buf: []byte, r: rune) -> string {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if buf == nil {
|
if buf == nil || r < 0 {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user