Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
libdmapsharing
Commits
7473ac29
Commit
7473ac29
authored
Sep 11, 2010
by
W. Michael Petullo
Browse files
Fix gint vs. guint / atoi vs. strtoul issues
Signed-off-by:
W. Michael Petullo
<
mike@flyn.org
>
parent
e374a2e4
Changes
3
Hide whitespace changes
Inline
Side-by-side
libdmapsharing/daap-share.c
View file @
7473ac29
...
...
@@ -839,7 +839,7 @@ databases_items_xxx (DMAPShare *share,
const
gchar
*
transcode_mimetype
;
const
gchar
*
rest_of_path
;
const
gchar
*
id_str
;
gint
id
;
g
u
int
id
;
const
gchar
*
range_header
;
guint64
filesize
;
guint64
offset
=
0
;
...
...
@@ -847,7 +847,7 @@ databases_items_xxx (DMAPShare *share,
rest_of_path
=
strchr
(
path
+
1
,
'/'
);
id_str
=
rest_of_path
+
9
;
id
=
atoi
(
id_str
);
id
=
strtoul
(
id_str
,
NULL
,
10
);
g_object_get
(
share
,
"db"
,
&
db
,
NULL
);
record
=
DAAP_RECORD
(
dmap_db_lookup_by_id
(
db
,
id
));
...
...
libdmapsharing/dmap-db.c
View file @
7473ac29
...
...
@@ -186,7 +186,7 @@ compare_record_property (DMAPRecord *record, const gchar *property_name, const g
g_value_unset
(
&
value
);
return
FALSE
;
}
accept
=
(
g_value_get_long
(
&
dest
)
==
a
to
i
(
property_value
));
accept
=
(
g_value_get_long
(
&
dest
)
==
str
to
l
(
property_value
,
NULL
,
10
));
g_value_unset
(
&
value
);
return
accept
;
}
else
if
(
g_value_type_transformable
(
G_VALUE_TYPE
(
&
value
),
G_TYPE_STRING
))
{
...
...
@@ -254,7 +254,7 @@ apply_filter (gpointer id, DMAPRecord *record, gpointer data)
query_value
=
def
->
value
;
if
(
g_strcmp0
(
query_key
,
"dmap.itemid"
)
==
0
)
{
if
(
GPOINTER_TO_UINT
(
id
)
==
atoi
(
query_value
))
{
if
(
GPOINTER_TO_UINT
(
id
)
==
strtoul
(
query_value
,
NULL
,
10
))
{
accept
=
TRUE
;
break
;
}
...
...
libdmapsharing/dmap-share.c
View file @
7473ac29
...
...
@@ -1684,7 +1684,7 @@ _dmap_share_databases (DMAPShare *share,
GNode
*
apso
;
struct
DMAPMetaDataMap
*
map
;
struct
MLCL_Bits
mb
=
{
NULL
,
0
};
gint
pl_id
;
g
u
int
pl_id
;
gchar
*
record_query
;
GSList
*
filter_def
;
GHashTable
*
records
;
...
...
@@ -1726,7 +1726,7 @@ _dmap_share_databases (DMAPShare *share,
g_list_free
(
keys
);
g_hash_table_destroy
(
records
);
}
else
{
pl_id
=
atoi
(
rest_of_path
+
14
);
pl_id
=
strtoul
(
rest_of_path
+
14
,
NULL
,
10
);
if
(
pl_id
==
1
)
{
gint32
num_songs
=
dmap_db_count
(
share
->
priv
->
db
);
dmap_structure_add
(
apso
,
DMAP_CC_MTCO
,
(
gint32
)
num_songs
);
...
...
@@ -1741,6 +1741,7 @@ _dmap_share_databases (DMAPShare *share,
record
=
dmap_container_db_lookup_by_id
(
share
->
priv
->
container_db
,
pl_id
);
entries
=
dmap_container_record_get_entries
(
record
);
/* FIXME: what if entries is NULL (handled in dmapd but should be [also] handled here)? */
num_songs
=
dmap_db_count
(
entries
);
dmap_structure_add
(
apso
,
DMAP_CC_MTCO
,
(
gint32
)
num_songs
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment