Changeset 648fec7a in subsurface


Ignore:
Timestamp:
Dec 17, 2017, 9:12:44 AM (5 weeks ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
6b80b41
Parents:
bd66ab1
git-author:
Dirk Hohndel <dirk@…> (12/17/17 08:44:43)
git-committer:
Dirk Hohndel <dirk@…> (12/17/17 09:12:44)
Message:

Cleanup: fix potential uninitialized use of uuid

And make sure we don't create a dive site for an empty location string.

Signed-off-by: Dirk Hohndel <dirk@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mobile-widgets/qmlmanager.cpp

    rb59778a r648fec7a  
    815815{
    816816        bool diveChanged = false;
    817         uint32_t uuid;
     817        uint32_t uuid = 0;
    818818        struct dive_site *ds = get_dive_site_for_dive(d);
    819819        if (myDive->location() != location) {
    820820                diveChanged = true;
    821                 if (!ds) {
     821                if (!ds)
    822822                        uuid = get_dive_site_uuid_by_name(qPrintable(location), NULL);
    823                         if (!uuid)
    824                                 uuid = create_dive_site(qPrintable(location), d->when);
    825                 }
     823                if (!uuid && !location.isEmpty())
     824                        uuid = create_dive_site(qPrintable(location), d->when);
    826825                d->dive_site_uuid = uuid;
    827826        }
Note: See TracChangeset for help on using the changeset viewer.