Skip to content

Commit 699d44a

Browse files
committed
usage of sizeof
1 parent ad47cd0 commit 699d44a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

a_sampdb.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ native db_num_fields(DBResult:dbresult);
7070
/// <param name="maxlength">The max length of the field</param>
7171
/// <remarks>Using an <b>invalid handle</b> will crash your server! Get a <b>valid handle</b> by using <a href="#db_open">db_open</a>. But it's protected against <b><c>NULL</c></b> references</remarks>
7272
/// <returns>Returns <b><c>1</c></b>, if the function was successful, otherwise <b><c>0</c></b> if <b><c>DBResult:dbresult</c></b> is a <b><c>NULL</c></b> reference or the column index not available.</returns>
73-
native db_field_name(DBResult:dbresult, field, result[], maxlength);
73+
native db_field_name(DBResult:dbresult, field, result[], maxlength = sizeof result);
7474

7575
/// <summary>Get the content of a field from <a href="#db_query">db_query</a>.</summary>
7676
/// <param name="dbresult">The result to get the data from</param>
@@ -79,7 +79,7 @@ native db_field_name(DBResult:dbresult, field, result[], maxlength);
7979
/// <param name="maxlength">The max length of the field</param>
8080
/// <remarks>Using an <b>invalid handle</b> will crash your server! Get a <b>valid handle</b> by using <a href="#db_open">db_open</a>. But it's protected against <b><c>NULL</c></b> references</remarks>
8181
/// <returns>Returns <b><c>1</c></b> if successful, otherwise <b><c>0</c></b> if <b><c>DBResult:dbresult</c></b> is a <b><c>NULL</c></b> reference or the column index not available.</returns>
82-
native db_get_field(DBResult:dbresult, field, result[], maxlength);
82+
native db_get_field(DBResult:dbresult, field, result[], maxlength = sizeof result);
8383

8484
/// <summary>Get the content of a field as an integer from <a href="#db_query">db_query</a>.</summary>
8585
/// <param name="result">The result to get the data from</param>
@@ -102,7 +102,7 @@ native Float:db_get_field_float(DBResult:result, field = 0);
102102
/// <param name="maxlength">The max length of the field</param>
103103
/// <remarks>Using an <b>invalid handle</b> will crash your server! Get a <b>valid handle</b> by using <a href="#db_open">db_open</a>. But it's protected against <b><c>NULL</c></b> references</remarks>
104104
/// <returns>Returns <b><c>1</c></b> if successful, otherwise <b><c>0</c></b> if <b><c>DBResult:dbresult</c></b> is a <b><c>NULL</c></b> reference or the column index not available.</returns>
105-
native db_get_field_assoc(DBResult:dbresult, const field[], result[], maxlength);
105+
native db_get_field_assoc(DBResult:dbresult, const field[], result[], maxlength = sizeof result);
106106

107107
/// <summary>Get the contents of field as an integer with specified name.</summary>
108108
/// <param name="result">The result to get the data from</param>

0 commit comments

Comments
 (0)